2013-09-07 11:03:57 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from waflib.extras import autowaf as autowaf
|
2013-09-19 16:17:03 -04:00
|
|
|
from waflib import Options
|
2013-09-07 11:03:57 -04:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
|
|
|
|
I18N_PACKAGE = 'jack-backend'
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
2013-12-03 05:21:17 -05:00
|
|
|
autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.121.0')
|
|
|
|
|
2013-09-19 16:17:03 -04:00
|
|
|
#
|
|
|
|
# PortAudio is currently used to get a list of audio device names.
|
|
|
|
# We should find a better way to do this that doesn't involve this
|
|
|
|
# kind of dependency.
|
|
|
|
#
|
|
|
|
if Options.options.dist_target == 'mingw':
|
|
|
|
autowaf.check_pkg(conf, 'portaudio-2.0', uselib_store='PORTAUDIO',
|
|
|
|
atleast_version='19')
|
2013-09-07 11:03:57 -04:00
|
|
|
|
2014-10-23 07:01:45 -04:00
|
|
|
if Options.options.libjack_link == 'auto':
|
|
|
|
if Options.options.dist_target == 'mingw' or sys.platform == 'darwin':
|
|
|
|
conf.env['libjack_link'] = "weak"
|
|
|
|
else:
|
|
|
|
conf.env['libjack_link'] = "link"
|
|
|
|
elif Options.options.libjack_link == 'weak':
|
|
|
|
conf.env['libjack_link'] = "weak"
|
|
|
|
else:
|
|
|
|
conf.env['libjack_link'] = "link"
|
|
|
|
|
2015-04-23 09:29:35 -04:00
|
|
|
# Check that metadata API is available and working
|
|
|
|
conf.check_cxx(fragment = "#include <jack/jack.h>\n#include <jack/metadata.h>\nint main(void) { jack_port_uuid(NULL); return 0; }\n",
|
|
|
|
mandatory = False,
|
|
|
|
msg = 'Checking for JACK metadata API',
|
2015-07-03 22:24:22 -04:00
|
|
|
execute = False,
|
|
|
|
features = ['cxx'],
|
2015-04-23 09:29:35 -04:00
|
|
|
okmsg = 'ok',
|
|
|
|
errmsg = 'not found (or broken). JACK metadata API will not be used',
|
|
|
|
define_name = 'HAVE_JACK_METADATA',
|
2015-04-23 13:48:02 -04:00
|
|
|
uselib = 'JACK')
|
2015-07-02 14:02:00 -04:00
|
|
|
|
|
|
|
# Check to see if jack_port_rename() is available and working
|
2016-07-01 13:08:52 -04:00
|
|
|
if conf.env['libjack_link'] == 'link':
|
2022-01-24 18:38:32 -05:00
|
|
|
conf.check_cxx(fragment = "#include <jack/jack.h>\nint main(void) { jack_client_t* c; jack_port_t* p; jack_port_rename (c, p, \"foo\"); return 0; }\n",
|
|
|
|
mandatory = False,
|
|
|
|
execute = False,
|
|
|
|
features = ['cxx'],
|
|
|
|
msg = 'Checking for jack_port_rename()',
|
|
|
|
okmsg = 'ok',
|
|
|
|
errmsg = 'not found (or broken). jack_port_rename() will not be used, and jack_port_set_name() will be used instead',
|
|
|
|
define_name = 'HAVE_JACK_PORT_RENAME',
|
|
|
|
uselib = 'JACK')
|
2015-07-02 14:02:00 -04:00
|
|
|
|
2013-09-07 11:03:57 -04:00
|
|
|
def build(bld):
|
2014-11-12 19:02:09 -05:00
|
|
|
obj = bld(features = 'c cxx cxxshlib')
|
2015-11-29 11:52:42 -05:00
|
|
|
obj.source = [
|
2013-09-07 11:03:57 -04:00
|
|
|
'jack_api.cc',
|
|
|
|
'jack_connection.cc',
|
|
|
|
'jack_audiobackend.cc',
|
|
|
|
'jack_portengine.cc',
|
2013-10-08 14:02:03 -04:00
|
|
|
'jack_utils.cc',
|
|
|
|
'jack_session.cc',
|
2014-10-23 07:01:45 -04:00
|
|
|
'weak_libjack.c',
|
2013-09-07 11:03:57 -04:00
|
|
|
]
|
|
|
|
obj.includes = ['.']
|
|
|
|
obj.name = 'jack_audiobackend'
|
|
|
|
obj.target = 'jack_audiobackend'
|
2015-11-29 11:52:42 -05:00
|
|
|
obj.defines = ['PACKAGE="' + I18N_PACKAGE + '"',
|
2013-09-13 12:32:50 -04:00
|
|
|
'ARDOURBACKEND_DLL_EXPORTS'
|
|
|
|
]
|
2014-10-23 07:01:45 -04:00
|
|
|
obj.use = 'libardour libpbd ardouralsautil'
|
|
|
|
obj.install_path = os.path.join(bld.env['LIBDIR'], 'backends')
|
2015-03-11 09:58:02 -04:00
|
|
|
if bld.env['build_target'] != 'mingw':
|
2020-01-13 18:52:01 -05:00
|
|
|
obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
|
|
|
obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
2015-07-03 23:43:34 -04:00
|
|
|
else:
|
|
|
|
obj.cxxflags = [ ]
|
|
|
|
obj.cflags = [ ]
|
2014-10-23 07:01:45 -04:00
|
|
|
|
2015-04-23 09:29:35 -04:00
|
|
|
if bld.is_defined ('HAVE_JACK_METADATA'):
|
2015-05-01 09:45:27 -04:00
|
|
|
obj.cxxflags += [ '-DHAVE_JACK_METADATA' ]
|
|
|
|
obj.cflags += [ '-DHAVE_JACK_METADATA' ]
|
2015-04-23 09:29:35 -04:00
|
|
|
|
2015-07-02 14:02:00 -04:00
|
|
|
if bld.is_defined ('HAVE_JACK_PORT_RENAME'):
|
|
|
|
obj.cxxflags += [ '-DHAVE_JACK_PORT_RENAME' ]
|
|
|
|
obj.cflags += [ '-DHAVE_JACK_PORT_RENAME' ]
|
|
|
|
|
2014-10-23 07:01:45 -04:00
|
|
|
if (bld.env['build_target'] == 'mingw'):
|
|
|
|
obj.uselib = [ 'PORTAUDIO' ]
|
|
|
|
else:
|
|
|
|
obj.uselib = [ ]
|
|
|
|
|
|
|
|
if bld.env['libjack_link'] == 'link':
|
|
|
|
obj.uselib += [ 'JACK' ]
|
2015-10-28 09:11:17 -04:00
|
|
|
elif bld.env['build_target'] == 'mingw':
|
|
|
|
obj.defines += [ 'USE_WEAK_JACK' ]
|
|
|
|
obj.deps = [ 'weak_libjack.def' ]
|
2014-10-23 07:01:45 -04:00
|
|
|
else:
|
2015-10-27 20:19:44 -04:00
|
|
|
obj.defines += [ 'USE_WEAK_JACK', 'HAVE_JACK_PORT_RENAME' ]
|
2014-10-24 09:18:38 -04:00
|
|
|
obj.deps = [ 'weak_libjack.def' ]
|
2013-09-07 11:03:57 -04:00
|
|
|
|
2022-01-25 14:43:15 -05:00
|
|
|
obj.uselib += [ 'GLIBMM', 'XML', 'OSX']
|
2016-02-28 15:16:44 -05:00
|
|
|
|
2013-09-07 11:03:57 -04:00
|
|
|
#
|
|
|
|
# device discovery code in the jack backend needs ALSA
|
|
|
|
# on Linux.
|
2015-11-29 11:52:42 -05:00
|
|
|
#
|
2013-09-07 11:03:57 -04:00
|
|
|
|
|
|
|
if re.search ("linux", sys.platform) != None:
|
2022-01-24 18:38:32 -05:00
|
|
|
obj.uselib += [ 'ALSA' ]
|