2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
5 # Version of this package (even if built as a child)
6 LIBSURFACES_VERSION = '4.1.0'
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'
14 # Variables for 'waf dist'
15 APPNAME = 'libsurfaces'
16 VERSION = LIBSURFACES_VERSION
29 autowaf.set_options(opt)
31 def sub_config_and_use(conf, name, has_objects = True):
33 autowaf.set_local_lib(conf, name, has_objects)
36 autowaf.set_recursive()
37 autowaf.configure(conf)
40 sub_config_and_use(conf, i)
42 if (conf.env['build_target'] == 'mingw'): return
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)
48 if conf.check_cc (header_name='poll.h', define_name='BUILD_MACKIE', mandatory=False):
49 sub_config_and_use(conf, 'mackie')
51 if autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24"):
52 sub_config_and_use(conf, 'osc')
54 conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
55 if conf.is_defined('HAVE_CWIID_H'):
56 conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H',mandatory=False)
57 if conf.is_defined('HAVE_BLUETOOTH_H'):
58 autowaf.check_pkg(conf, 'cwiid', uselib_store='CWIID', atleast_version='0.6.00',mandatory=False)
59 if conf.is_defined ('HAVE_CWIID'):
60 conf.define ('BUILD_WIIMOTE', 1)
61 sub_config_and_use(conf, 'wiimote')
63 print('You have the cwiid headers needed to compile wiimote support BUT you are missing the pkg-config file for cwiid')
65 print('You are missing the libbluetooth headers needed to compile wiimote support')
67 print('You are missing the cwiid headers needed to compile wiimote support')
70 bld.recurse('control_protocol')
71 if (bld.env['build_target'] == 'mingw'): return
72 if bld.is_defined ('BUILD_MACKIE'):
74 if bld.is_defined ('HAVE_LO'):
76 if bld.is_defined('BUILD_WIIMOTE'):
77 bld.recurse('wiimote')
78 if bld.is_defined('BUILD_TRANZPORT'):
79 bld.recurse('tranzport')