Waf building of rubberband.
[ardour.git] / libs / ardour / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import os
4
5 # Version of this package (even if built as a child)
6 LIBARDOUR_VERSION = '3.0.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 LIBARDOUR_LIB_VERSION = '3.0.0'
13
14 # Variables for 'waf dist'
15 APPNAME = 'libardour'
16 VERSION = LIBARDOUR_VERSION
17
18 # Mandatory variables
19 srcdir = '.'
20 blddir = 'build'
21
22 def set_options(opt):
23         autowaf.set_options(opt)
24
25 def check_header_and_define(conf, header, define):
26         conf.check(header_name=header, define_name=define)
27         if conf.env[define]:
28                 conf.env.append_value('CCFLAGS', '-D' + define)
29                 conf.env.append_value('CXXFLAGS', '-D' + define)
30         
31 def configure(conf):
32         autowaf.configure(conf)
33         autowaf.check_tool(conf, 'compiler_cxx')
34         autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
35         autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
36         autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
37         autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
38         autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
39         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
40         autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
41         #autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH')
42
43         conf.env.append_value('CXXFLAGS', '-DUSE_RUBBERBAND')
44         
45         check_header_and_define(conf, 'sys/vfs.h', 'HAVE_SYS_VFS_H')
46         check_header_and_define(conf, 'wordexp.h', 'HAVE_WORDEXP')
47
48         conf.env.append_value('CCFLAGS', '-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE')
49         conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
50         
51         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
52         conf.write_config_header('wafconfig.h')
53
54         # Boost headers
55         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
56         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
57
58 def build(bld):
59         # Library
60         obj = bld.new_task_gen('cxx', 'shlib')
61         obj.source = '''
62                 amp.cc
63                 analyser.cc
64                 audio_buffer.cc
65                 audio_diskstream.cc
66                 audio_library.cc
67                 audio_playlist.cc
68                 audio_playlist_importer.cc
69                 audio_port.cc
70                 audio_region_importer.cc
71                 audio_track.cc
72                 audio_track_importer.cc
73                 audioanalyser.cc
74                 audioengine.cc
75                 audiofile_tagger.cc
76                 audiofilesource.cc
77                 audioregion.cc
78                 audiosource.cc
79                 auditioner.cc
80                 automatable.cc
81                 automation.cc
82                 automation_control.cc
83                 automation_list.cc
84                 beats_frames_converter.cc
85                 broadcast_info.cc
86                 buffer.cc
87                 buffer_set.cc
88                 bundle.cc
89                 chan_count.cc
90                 configuration.cc
91                 control_protocol_manager.cc
92                 control_protocol_search_path.cc
93                 crossfade.cc
94                 cycle_timer.cc
95                 default_click.cc
96                 directory_names.cc
97                 diskstream.cc
98                 element_import_handler.cc
99                 element_importer.cc
100                 enums.cc
101                 event_type_map.cc
102                 export_channel.cc
103                 export_channel_configuration.cc
104                 export_file_io.cc
105                 export_filename.cc
106                 export_format_base.cc
107                 export_format_manager.cc
108                 export_format_specification.cc
109                 export_formats.cc
110                 export_handler.cc
111                 export_preset.cc
112                 export_processor.cc
113                 export_profile_manager.cc
114                 export_status.cc
115                 export_timespan.cc
116                 export_utilities.cc
117                 filename_extensions.cc
118                 file_source.cc
119                 filesystem_paths.cc
120                 filter.cc
121                 find_session.cc
122                 gain.cc
123                 gdither.cc
124                 globals.cc
125                 import.cc
126                 io.cc
127                 io_processor.cc
128                 jack_slave.cc
129                 ladspa_plugin.cc
130                 location.cc
131                 location_importer.cc
132                 meter.cc
133                 midi_buffer.cc
134                 midi_clock_slave.cc
135                 midi_diskstream.cc
136                 midi_model.cc
137                 midi_patch_manager.cc
138                 midi_playlist.cc
139                 midi_port.cc
140                 midi_region.cc
141                 midi_ring_buffer.cc
142                 midi_source.cc
143                 midi_state_tracker.cc
144                 midi_stretch.cc
145                 midi_track.cc
146                 mix.cc
147                 mtc_slave.cc
148                 named_selection.cc
149                 onset_detector.cc
150                 panner.cc
151                 pcm_utils.cc
152                 playlist.cc
153                 playlist_factory.cc
154                 plugin.cc
155                 plugin_insert.cc
156                 plugin_manager.cc
157                 port.cc
158                 port_insert.cc
159                 port_set.cc
160                 processor.cc
161                 quantize.cc
162                 recent_sessions.cc
163                 region.cc
164                 region_factory.cc
165                 resampled_source.cc
166                 reverse.cc
167                 route.cc
168                 route_group.cc
169                 send.cc
170                 session.cc
171                 session_butler.cc
172                 session_click.cc
173                 session_command.cc
174                 session_directory.cc
175                 session_events.cc
176                 session_export.cc
177                 session_metadata.cc
178                 session_midi.cc
179                 session_process.cc
180                 session_state.cc
181                 session_state_utils.cc
182                 session_time.cc
183                 session_transport.cc
184                 session_utils.cc
185                 smf_source.cc
186                 sndfile_helpers.cc
187                 sndfileimportable.cc
188                 sndfilesource.cc
189                 source.cc
190                 source_factory.cc
191                 svn_revision.cc
192                 tape_file_matcher.cc
193                 template_utils.cc
194                 tempo.cc
195                 tempo_map_importer.cc
196                 ticker.cc
197                 track.cc
198                 transient_detector.cc
199                 user_bundle.cc
200                 utils.cc
201                 version.cc
202         '''
203         obj.export_incdirs = ['.']
204         obj.includes     = ['.', '../surfaces/control_protocol']
205         obj.name         = 'libardour'
206         obj.target       = 'ardour'
207         obj.uselib       = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF'
208         obj.uselib_local = 'libpbd libmidipp libevoral libvamp libtaglib'
209         obj.vnum         = LIBARDOUR_LIB_VERSION
210         obj.install_path = ''
211         obj.cxxflags     = ' -DPACKAGE=\\\"libardour3\\\"'
212         obj.cxxflags     += ' -DDATA_DIR=\\\"' + os.path.normpath(bld.env['DATADIRNAME']) + '\\\"'
213         obj.cxxflags     += ' -DCONFIG_DIR=\\\"' + os.path.normpath(bld.env['CONFIGDIRNAME']) + '\\\"'
214         obj.cxxflags     += ' -DMODULE_DIR=\\\"' + os.path.normpath(bld.env['LIBDIRNAME']) + '\\\"'
215         obj.cxxflags     += ' -DLOCALEDIR=\\\"' + os.path.join(
216                         os.path.normpath(bld.env['DATADIRNAME']), 'locale') + '\\\"'
217         obj.cxxflags     += ' -DVAMP_DIR=\\\"' + os.path.join(
218                         os.path.normpath(bld.env['LIBDIRNAME']), 'ardour3', 'vamp') + '\\\"'
219         obj.source += ' rb_effect.cc '
220         obj.uselib_local += ' librubberband '
221         #obj.source += ' st_stretch.cc st_pitch.cc '
222         #obj.uselib += ' SOUNDTOUCH '
223         
224 def shutdown():
225         autowaf.shutdown()
226