make i18n build work ; add mackie dir back to build ; token work on amp for MIDI...
[ardour.git] / libs / surfaces / wscript
1 #!/usr/bin/env python
2 import autowaf
3 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 srcdir = '.'
20 blddir = 'build'
21
22 def set_options(opt):
23         autowaf.set_options(opt)
24
25 def configure(conf):
26         autowaf.configure(conf)
27
28         conf.check_cc (lib='libusb', header_name='libusb.h', function_name='usb_interrupt_write', define_name='BUILD_TRANZPORT')
29         conf.check_cc (header_name='linux/input.h', define_name='BUILD_POWERMATE')
30         conf.check_cc (lib='lo', header_name='lo/lo.h', function_name='lo_server_new', define_name='BUILD_OSC')
31         
32         if Options.options.wiimote:
33                 conf.check_cc (header_name='cwiid.h',define_name='HAVE_CWIID_H')
34                 if not conf.env['HAVE_CWIID_H']:
35                         print 'WIIMOTE configured but you are missing libcwiid!'
36                         sys.exit(1)
37                 conf.check_cc (header_name='bluetooth/bluetooth.h',define_name='HAVE_BLUETOOTH_H')
38                 if not conf.env['HAVE_BLUETOOTH_H']:
39                         print 'WIIMOTE configured but you are missing the libbluetooth headers needed to compile wiimote support!'
40                         sys.exit(1)
41                 conf.define ('BUILD_WIIMOTE', 1)
42
43 def build(bld):
44         bld.add_subdirs('control_protocol')
45         bld.add_subdirs('generic_midi')
46         bld.add_subdirs('mackie')
47         if bld.env['BUILD_OSC']:
48                 bld.add_subdirs('osc')
49         if bld.env['BUILD_POWERMATE']:
50                 bld.add_subdirs('powermate')
51         if bld.env['BUILD_WIIMOTE']:
52                 bld.add_subdirs('wiimote')
53         if bld.env['BUILD_TRANZPORT']:
54                 bld.add_subdirs('tranzport')
55
56 def shutdown():
57         autowaf.shutdown()
58