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
|
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
JACKBACKEND_VERSION = '1.0.0'
|
|
|
|
I18N_PACKAGE = 'jack-backend'
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
|
|
|
|
|
|
|
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
|
|
|
autowaf.configure(conf)
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
2013-09-07 11:03:57 -04:00
|
|
|
def build(bld):
|
|
|
|
obj = bld(features = 'cxx cxxshlib')
|
|
|
|
obj.source = [
|
|
|
|
'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'
|
2013-09-13 12:32:50 -04:00
|
|
|
obj.defines = ['PACKAGE="' + I18N_PACKAGE + '"',
|
|
|
|
'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')
|
2014-10-23 14:34:44 -04:00
|
|
|
obj.cxxflags = [ '-fPIC' ]
|
|
|
|
obj.cflags = [ '-fPIC' ]
|
2014-10-23 07:01:45 -04:00
|
|
|
|
|
|
|
if (bld.env['build_target'] == 'mingw'):
|
|
|
|
obj.uselib = [ 'PORTAUDIO' ]
|
|
|
|
else:
|
|
|
|
obj.uselib = [ ]
|
|
|
|
obj.vnum = JACKBACKEND_VERSION
|
|
|
|
|
|
|
|
if bld.env['libjack_link'] == 'link':
|
|
|
|
obj.uselib += [ 'JACK' ]
|
|
|
|
else:
|
|
|
|
obj.defines += [ 'USE_WEAK_JACK' ]
|
2014-10-24 09:18:38 -04:00
|
|
|
obj.deps = [ 'weak_libjack.def' ]
|
2013-09-07 11:03:57 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# device discovery code in the jack backend needs ALSA
|
|
|
|
# on Linux.
|
|
|
|
#
|
|
|
|
|
|
|
|
if re.search ("linux", sys.platform) != None:
|
|
|
|
obj.uselib += [ 'ALSA' ]
|
|
|
|
|