Fix track rename oddity, don't skip over current name.
[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         'us2400',
30 ]
31
32 def options(opt):
33     autowaf.set_options(opt)
34
35 def sub_config_and_use(conf, name, has_objects = True):
36     conf.recurse(name)
37     autowaf.set_local_lib(conf, name, has_objects)
38
39 def configure(conf):
40     global children
41
42     autowaf.set_recursive()
43     autowaf.configure(conf)
44
45     autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
46     #if Options.options.tranzport and conf.is_defined('HAVE_USB'):
47     #    conf.define('BUILD_TRANZPORT', 1)
48
49     if conf.is_defined('HAVE_USB'):
50         children += [ 'push2' ]
51     else:
52         print ('You are missing the libusb-1.0 development package needed to compile Push2 support')
53     
54     if conf.is_defined('HAVE_HIDAPI') and Options.options.maschine:
55         children += [ 'maschine2' ]
56         conf.define('BUILD_MASCHINE', 1)
57
58     if autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24"):
59         children += [ 'osc' ]
60
61     conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
62     if conf.is_defined('HAVE_CWIID_H'):
63         conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H',mandatory=False)
64         if conf.is_defined('HAVE_BLUETOOTH_H'):
65             autowaf.check_pkg(conf, 'cwiid', uselib_store='CWIID', atleast_version='0.6.00',mandatory=False)
66             if conf.is_defined ('HAVE_CWIID'):
67                 conf.define ('BUILD_WIIMOTE', 1)
68                 children += [ 'wiimote' ]
69             else:
70                 print('You have the cwiid headers needed to compile wiimote support BUT you are missing the pkg-config file for cwiid')
71         else:
72             print('You are missing the libbluetooth headers needed to compile wiimote support')
73     else:
74             print('You are missing the cwiid headers needed to compile wiimote support')
75
76     for i in children:
77         sub_config_and_use(conf, i)
78
79
80 def build(bld):
81     bld.recurse('control_protocol')
82     bld.recurse('generic_midi')
83     bld.recurse('faderport')
84     bld.recurse('faderport8')
85     bld.recurse('cc121')
86     bld.recurse('mackie')
87     bld.recurse('us2400')
88
89     if bld.is_defined ('HAVE_LO'):
90         bld.recurse('osc')
91     if bld.is_defined('BUILD_WIIMOTE'):
92         bld.recurse('wiimote')
93     if bld.is_defined('BUILD_TRANZPORT'):
94         bld.recurse('tranzport')
95     if bld.is_defined('HAVE_USB'):
96         bld.recurse('push2')
97     if bld.is_defined('BUILD_MASCHINE'):
98         bld.recurse('maschine2')
99
100 def shutdown():
101     autowaf.shutdown()