Upgrade to waf 1.5.4.
[ardour.git] / libs / rubberband / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import glob
4 import os
5
6 # Version of this package (even if built as a child)
7 LIBRUBBERBAND_VERSION = '0.0.0'
8
9 # Library version (UNIX style major, minor, micro)
10 # major increment <=> incompatible changes
11 # minor increment <=> compatible changes (additions)
12 # micro increment <=> no interface changes
13 LIBRUBBERBAND_LIB_VERSION = '4.1.0'
14
15 # Variables for 'waf dist'
16 APPNAME = 'librubberband'
17 VERSION = LIBRUBBERBAND_VERSION
18
19 # Mandatory variables
20 srcdir = '.'
21 blddir = 'build'
22
23 def set_options(opt):
24         autowaf.set_options(opt)
25
26 def configure(conf):
27         autowaf.configure(conf)
28         autowaf.check_tool(conf, 'compiler_cxx')
29         autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
30         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
31         autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
32
33         conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
34
35         # This must be defined for librubberband only, it breaks ardour
36         conf.check(header_name='execinfo.h', define_name='PBD_HAVE_EXECINFO')
37
38         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
39         conf.write_config_header('wafconfig.h')
40
41         # Boost headers
42         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
43         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
44
45 def build(bld):
46         # Library
47         obj = bld.new_task_gen('cxx', 'shlib')
48         prefix = 'libs/rubberband/'
49         sources = glob.glob(prefix + 'src/*.cpp')
50         obj.source = [ ]
51         for i in sources:
52                 obj.source += [ i.replace(prefix, '') ]
53         obj.export_incdirs = ['.']
54         obj.includes     = ['.', 'rubberband']
55         obj.name         = 'librubberband'
56         obj.target       = 'rubberband'
57         obj.uselib       = 'FFTW3 FFTW3F SAMPLERATE SNDFILE'
58         obj.uselib_local = 'libvamphost'
59         obj.vnum         = LIBRUBBERBAND_LIB_VERSION
60         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
61         obj.cxxflags     = '-DPACKAGE="librubberband"'
62         
63 def shutdown():
64         autowaf.shutdown()
65