Commit 509e31d6 authored by Nedko Arnaudov's avatar Nedko Arnaudov
Browse files

fix build when libsamplerate is missing

parent 46017940
......@@ -11,6 +11,7 @@ def configure(conf):
if conf.is_defined('HAVE_SAMPLERATE'):
conf.env['LIB_SAMPLERATE'] = ['samplerate']
conf.env['BUILD_NETLIB'] = conf.is_defined('HAVE_SAMPLERATE')
conf.env['BUILD_ADAPTER'] = conf.is_defined('HAVE_SAMPLERATE')
def create_jack_process_obj(bld, target, sources, uselib = None):
......@@ -182,37 +183,39 @@ def build(bld):
if bld.env['IS_SUN']:
serverlib.env.append_value("LINKFLAGS", "-lnsl -lsocket")
netlib = bld.new_task_gen('cxx', 'shlib')
netlib.features.append('cc')
netlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
netlib.includes = includes
netlib.name = 'netlib'
netlib.target = 'jacknet'
netlib.uselib = ['SAMPLERATE', 'CELT']
netlib.install_path = '${LIBDIR}'
netlib.source = ['JackNetAPI.cpp',
'JackNetInterface.cpp',
'JackNetTool.cpp',
'JackAudioAdapterInterface.cpp',
'JackLibSampleRateResampler.cpp',
'JackResampler.cpp',
'JackGlobals.cpp',
'ringbuffer.c']
if bld.env['IS_LINUX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../linux/JackLinuxTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_SUN']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../solaris/JackSolarisTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['BUILD_NETLIB'] == True:
netlib = bld.new_task_gen('cxx', 'shlib')
netlib.features.append('cc')
netlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
netlib.includes = includes
netlib.name = 'netlib'
netlib.target = 'jacknet'
netlib.uselib = ['SAMPLERATE', 'CELT']
netlib.install_path = '${LIBDIR}'
netlib.source = [
'JackNetAPI.cpp',
'JackNetInterface.cpp',
'JackNetTool.cpp',
'JackAudioAdapterInterface.cpp',
'JackLibSampleRateResampler.cpp',
'JackResampler.cpp',
'JackGlobals.cpp',
'ringbuffer.c']
if bld.env['IS_LINUX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../linux/JackLinuxTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_SUN']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../solaris/JackSolarisTime.c']
netlib.env.append_value("CPPFLAGS", "-fvisibility=hidden")
if bld.env['IS_MACOSX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../macosx/JackMachThread.cpp', '../macosx/JackMachTime.c']
netlib.env.append_value("LINKFLAGS", "-framework CoreAudio -single_module")
if bld.env['IS_MACOSX']:
netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../macosx/JackMachThread.cpp', '../macosx/JackMachTime.c']
netlib.env.append_value("LINKFLAGS", "-framework CoreAudio -single_module")
netlib.vnum = bld.env['JACK_API_VERSION']
netlib.vnum = bld.env['JACK_API_VERSION']
clientlib = bld.new_task_gen('cxx', 'shlib')
clientlib.features.append('cc')
......
......@@ -39,11 +39,6 @@ example_libs = {
def configure(conf):
e = conf.check_cc(header_name='sndfile.h', define_name="HAVE_SNDFILE")
conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE")
if conf.is_defined('HAVE_SAMPLERATE'):
conf.env['LIB_SAMPLERATE'] = ['samplerate']
if conf.is_defined('HAVE_SNDFILE'):
conf.env['LIB_SNDFILE'] = ['sndfile']
......@@ -74,6 +69,19 @@ def build(bld):
if bld.env['IS_SUN']:
os_incdir = ['../solaris', '../posix']
for example_program, example_program_source in example_programs.items():
if example_program == 'jack_server_control':
uselib_local = 'serverlib'
elif example_program == 'jack_net_slave':
if not bld.env['BUILD_NETLIB']:
continue
uselib_local = 'netlib'
elif example_program == 'jack_net_master':
if not bld.env['BUILD_NETLIB']:
continue
uselib_local = 'netlib'
else:
uselib_local = 'clientlib'
prog = bld.new_task_gen('cxx', 'program')
prog.features.append('cc')
prog.includes = os_incdir + ['../common/jack', '../common']
......@@ -86,14 +94,8 @@ def build(bld):
prog.uselib = 'RT'
if bld.env['IS_SUN']:
prog.env.append_value("LINKFLAGS", "-lm")
if example_program == 'jack_server_control':
prog.uselib_local = 'serverlib'
elif example_program == 'jack_net_slave':
prog.uselib_local = 'netlib'
elif example_program == 'jack_net_master':
prog.uselib_local = 'netlib'
else:
prog.uselib_local = 'clientlib'
prog.uselib_local = uselib_local
prog.target = example_program
......
......@@ -127,6 +127,12 @@ def configure(conf):
conf.sub_config('dbus')
if conf.env['BUILD_JACKDBUS'] != True:
conf.fatal('jackdbus was explicitly requested but cannot be built')
conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE")
if conf.is_defined('HAVE_SAMPLERATE'):
conf.env['LIB_SAMPLERATE'] = ['samplerate']
conf.sub_config('example-clients')
if conf.check_cfg(package='celt', atleast_version='0.11.0', args='--cflags --libs'):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment