summaryrefslogtreecommitdiffstats
path: root/build/features.py
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2019-02-25 01:26:03 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2019-08-15 23:11:48 +0200
commit4b9293e927969781542c5ccaaf4eab33b8482047 (patch)
tree4869fe192d9972672ba76d1032cae3609bd58abc /build/features.py
parentf01422e345c93c9b01a0e42bec6a287767a6252d (diff)
Added ths static libshout config to scons
Diffstat (limited to 'build/features.py')
-rw-r--r--build/features.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/build/features.py b/build/features.py
index 1a7bfe1ccc..f0c9873dc0 100644
--- a/build/features.py
+++ b/build/features.py
@@ -810,16 +810,29 @@ class LiveBroadcasting(Feature):
return True
return False
+ def internal_link(self, build):
+ build.flags['shoutcast_internal'] = util.get_flags(build.env, 'shoutcast_internal', 1)
+ if int(build.flags['shoutcast_internal']):
+ return True
+ return False
+
def add_options(self, build, vars):
vars.Add('shoutcast', 'Set to 1 to enable live broadcasting support', 1)
+ vars.Add('shoutcast_internal', 'Set to 1 to use internal libshout', 1)
def configure(self, build, conf):
if not self.enabled(build):
return
- libshout_found = conf.CheckLib(['libshout', 'shout'])
build.env.Append(CPPDEFINES='__BROADCAST__')
+ if self.internal_link(build):
+ build.env.Append(CPPPATH='include')
+ build.env.Append(CPPPATH='src')
+ return
+
+ libshout_found = conf.CheckLib(['libshout', 'shout'])
+
if not libshout_found:
raise Exception('Could not find libshout or its development headers. Please install it or compile Mixxx without Shoutcast support using the shoutcast=0 flag.')
@@ -829,6 +842,26 @@ class LiveBroadcasting(Feature):
conf.CheckLib('gdi32')
def sources(self, build):
+ if self.internal_link(build):
+ # Clone our main environment so we don't change any settings in the
+ # Mixxx environment
+ libshout_env = build.env.Clone()
+
+ if build.toolchain_is_gnu:
+ libshout_env.Append(CCFLAGS='-pthread')
+ libshout_env.Append(LINKFLAGS='-pthread')
+
+ libshout_env.Append(CPPPATH="#lib/libshout")
+ libshout_dir = libshout_env.Dir("#lib/libshout")
+
+ env = libshout_env
+ SCons.Export('env')
+ SCons.Export('build')
+ env.SConscript(env.File('SConscript', libshout_dir))
+
+ build.env.Append(LIBPATH=libshout_dir)
+ build.env.Append(LIBS=['libshout_mixxx', 'libogg', 'vorbis', 'theora', 'speex', 'ssl', 'crypto'])
+
depends.Qt.uic(build)('preferences/dialog/dlgprefbroadcastdlg.ui')
return ['preferences/dialog/dlgprefbroadcast.cpp',
'broadcast/broadcastmanager.cpp',