Merge branch 'master' into windows
[ardour.git] / libs / backends / jack / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4 import os
5 import sys
6 import re
7
8 # Library version (UNIX style major, minor, micro)
9 # major increment <=> incompatible changes
10 # minor increment <=> compatible changes (additions)
11 # micro increment <=> no interface changes
12 JACKBACKEND_VERSION = '1.0.0'
13 I18N_PACKAGE = 'jack-backend'
14
15 # Mandatory variables
16 top = '.'
17 out = 'build'
18
19 def options(opt):
20     autowaf.set_options(opt)
21
22 def configure(conf):
23     #
24     # PortAudio is currently used to get a list of audio device names.
25     # We should find a better way to do this that doesn't involve this
26     # kind of dependency.
27     #
28     if Options.options.dist_target == 'mingw':
29         autowaf.check_pkg(conf, 'portaudio-2.0', uselib_store='PORTAUDIO',
30                           atleast_version='19')
31     autowaf.configure(conf)
32
33 def build(bld):
34     obj = bld(features = 'cxx cxxshlib')
35     obj.source = [ 
36             'jack_api.cc',
37             'jack_connection.cc',
38             'jack_audiobackend.cc',
39             'jack_portengine.cc',
40             'jack_utils.cc',
41             'jack_session.cc',
42             ]
43     obj.includes = ['.']
44     obj.name     = 'jack_audiobackend'
45     obj.target   = 'jack_audiobackend'
46     if Options.options.dist_target == 'mingw':
47         obj.uselib   = [ 'JACK', 'PORTAUDIO' ]
48     else:
49         obj.uselib   = [ 'JACK' ]
50     obj.use      = 'ardour libpbd'
51     obj.vnum     = JACKBACKEND_VERSION
52     obj.install_path  = os.path.join(bld.env['LIBDIR'], 'ardour3', 'backends')
53     obj.defines = ['PACKAGE="' + I18N_PACKAGE + '"', 
54                    'ARDOURBACKEND_DLL_EXPORTS'
55                    ]
56
57     #
58     # device discovery code in the jack backend needs ALSA
59     # on Linux.
60     # 
61
62     if re.search ("linux", sys.platform) != None:
63        obj.uselib += [ 'ALSA' ]
64