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