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.

(cherry picked from commit abf6a0919b)
This commit is contained in:
Rémi Verschelde 2025-01-03 22:43:12 +01:00
parent a3a3cafbc8
commit 7ae44a055b
No known key found for this signature in database
GPG key ID: C3336907360768E1
4 changed files with 63 additions and 17 deletions

View file

@ -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.")
@ -61,8 +56,9 @@ def get_opts():
def get_flags():
return [
('builtin_zlib', 'no'),
("openssl", "yes"),
('builtin_zlib', 'yes'),
("openssl", "builtin"),
("freetype", "builtin"),
("theora","no"),
]
@ -126,13 +122,18 @@ def configure(env):
env.ParseConfig('pkg-config x11 --cflags --libs')
env.ParseConfig('pkg-config xinerama --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"])
@ -145,17 +146,19 @@ def configure(env):
print("PulseAudio development libraries not found, disabling driver")
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_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'])
import methods