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