tweaks to the beatbox toy to properly track and connect note on/off
[ardour.git] / libs / surfaces / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4
5 # Version of this package (even if built as a child)
6 LIBSURFACES_VERSION = '4.1.0'
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 LIBSURFACES_LIB_VERSION = '4.1.0'
13
14 # Variables for 'waf dist'
15 APPNAME = 'libsurfaces'
16 VERSION = LIBSURFACES_VERSION
17
18 # Mandatory variables
19 top = '.'
20 out = 'build'
21
22 children = [
23         'control_protocol',
24         'faderport',
25         'faderport8',
26         'cc121',
27         'generic_midi',
28         'mackie',
29 ]
30
31 def options(opt):
32     autowaf.set_options(opt)
33
34 def sub_config_and_use(conf, name, has_objects = True):
35     conf.recurse(name)
36     autowaf.set_local_lib(conf, name, has_objects)
37
38 def configure(conf):
39     global children
40
41     autowaf.set_recursive()
42     autowaf.configure(conf)
43
44     autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
45     #if Options.options.tranzport and conf.is_defined('HAVE_USB'):
46     #    conf.define('BUILD_TRANZPORT', 1)
47
48     if conf.is_defined('HAVE_USB'):
49         children += [ 'push2' ]
50     else:
51         print ('You are missing the libusb-1.0 development package needed to compile Push2 support')
52     
53     if conf.is_defined('HAVE_HIDAPI') and Options.options.maschine:
54         children += [ 'maschine2' ]
55         conf.define('BUILD_MASCHINE', 1)
56
57     if autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24"):
58         children += [ 'osc' ]
59
60     conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
61     if conf.is_defined('HAVE_CWIID_H'):
62         conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H',mandatory=False)
63         if conf.is_defined('HAVE_BLUETOOTH_H'):
64             autowaf.check_pkg(conf, 'cwiid', uselib_store='CWIID', atleast_version='0.6.00',mandatory=False)
65             if conf.is_defined ('HAVE_CWIID'):
66                 conf.define ('BUILD_WIIMOTE', 1)
67                 children += [ 'wiimote' ]
68             else:
69                 print('You have the cwiid headers needed to compile wiimote support BUT you are missing the pkg-config file for cwiid')
70         else:
71             print('You are missing the libbluetooth headers needed to compile wiimote support')
72     else:
73             print('You are missing the cwiid headers needed to compile wiimote support')
74
75     for i in children:
76         sub_config_and_use(conf, i)
77
78
79 def build(bld):
80     bld.recurse('control_protocol')
81     bld.recurse('generic_midi')
82     bld.recurse('faderport')
83     bld.recurse('faderport8')
84     bld.recurse('cc121')
85     bld.recurse('mackie')
86
87     if bld.is_defined ('HAVE_LO'):
88         bld.recurse('osc')
89     if bld.is_defined('BUILD_WIIMOTE'):
90         bld.recurse('wiimote')
91     if bld.is_defined('BUILD_TRANZPORT'):
92         bld.recurse('tranzport')
93     if bld.is_defined('HAVE_USB'):
94         bld.recurse('push2')
95     if bld.is_defined('BUILD_MASCHINE'):
96         bld.recurse('maschine2')
97
98 def shutdown():
99     autowaf.shutdown()