aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2016-11-03 22:53:18 +0100
committerRémi Verschelde2016-11-03 22:55:24 +0100
commitcd828bd5fcf8bbd021e28b834e9b7c0f0dcc08aa (patch)
treed73b2f3cecb6a97e3c0911c5eecaa8a7c64f6c08
parentda4a870bc40ebf62a13a8a136f43858cce78f66c (diff)
downloadgodot-cd828bd5fcf8bbd021e28b834e9b7c0f0dcc08aa.tar.gz
godot-cd828bd5fcf8bbd021e28b834e9b7c0f0dcc08aa.tar.zst
godot-cd828bd5fcf8bbd021e28b834e9b7c0f0dcc08aa.zip
server: Allow building against system libraries
(cherry picked from commit 5e360fe178e4fae0fd750d2daf7457a28268ffcd)
Diffstat (limited to '')
-rw-r--r--platform/server/detect.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/platform/server/detect.py b/platform/server/detect.py
index b367e1f2c..caad6d738 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -66,6 +66,42 @@ def configure(env):
env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ # Shared libraries, when requested
+
+ if (env['builtin_openssl'] == 'no'):
+ env.ParseConfig('pkg-config openssl --cflags --libs')
+
+ if (env['builtin_libwebp'] == 'no'):
+ env.ParseConfig('pkg-config libwebp --cflags --libs')
+
+ if (env['builtin_freetype'] == 'no'):
+ env['builtin_libpng'] = 'no' # Freetype links against libpng
+ env.ParseConfig('pkg-config freetype2 --cflags --libs')
+
+ if (env['builtin_libpng'] == 'no'):
+ env.ParseConfig('pkg-config libpng --cflags --libs')
+
+ # Sound and video libraries
+ # Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
+
+ if (env['builtin_libtheora'] == 'no'):
+ env['builtin_libogg'] = 'no' # Needed to link against system libtheora
+ env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora
+ env.ParseConfig('pkg-config theora theoradec --cflags --libs')
+
+ if (env['builtin_libvorbis'] == 'no'):
+ env['builtin_libogg'] = 'no' # Needed to link against system libvorbis
+ env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs')
+
+ if (env['builtin_opus'] == 'no'):
+ env['builtin_libogg'] = 'no' # Needed to link against system opus
+ env.ParseConfig('pkg-config opus opusfile --cflags --libs')
+
+ if (env['builtin_libogg'] == 'no'):
+ env.ParseConfig('pkg-config ogg --cflags --libs')
+
+
env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
env.Append(LIBS=['pthread', 'z']) # TODO detect linux/BSD!