Add --single-tests option to also build each libardour test as a separate program
[ardour.git] / libs / ardour / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4 import os
5 import re
6 import subprocess
7
8 # default state file version for this build
9 CURRENT_SESSION_FILE_VERSION = 3001
10
11 # Variables for 'waf dist'
12 APPNAME = 'libardour3'
13 I18N_PACKAGE = 'ardour3'
14
15 # Mandatory variables
16 top = '.'
17 out = 'build'
18
19 path_prefix = 'libs/ardour/'
20
21 libardour_sources = [
22         'amp.cc',
23         'analyser.cc',
24         'audio_buffer.cc',
25         'audio_diskstream.cc',
26         'audio_library.cc',
27         'audio_playlist.cc',
28         'audio_playlist_importer.cc',
29         'audio_playlist_source.cc',
30         'audio_port.cc',
31         'audio_region_importer.cc',
32         'audio_track.cc',
33         'audio_track_importer.cc',
34         'audioanalyser.cc',
35         'audioengine.cc',
36         'audiofile_tagger.cc',
37         'audiofilesource.cc',
38         'audioregion.cc',
39         'audiosource.cc',
40         'auditioner.cc',
41         'automatable.cc',
42         'automation.cc',
43         'automation_control.cc',
44         'automation_list.cc',
45         'automation_watch.cc',
46         'beats_frames_converter.cc',
47         'broadcast_info.cc',
48         'buffer.cc',
49         'buffer_manager.cc',
50         'buffer_set.cc',
51         'bundle.cc',
52         'butler.cc',
53         'capturing_processor.cc',
54         'chan_count.cc',
55         'chan_mapping.cc',
56         'configuration.cc',
57         'config_text.cc',
58         'control_protocol_manager.cc',
59         'control_protocol_search_path.cc',
60         'cycle_timer.cc',
61         'data_type.cc',
62         'default_click.cc',
63         'debug.cc',
64         'delivery.cc',
65         'directory_names.cc',
66         'diskstream.cc',
67         'element_import_handler.cc',
68         'element_importer.cc',
69         'enums.cc',
70         'event_type_map.cc',
71         'export_channel.cc',
72         'export_channel_configuration.cc',
73         'export_failed.cc',
74         'export_filename.cc',
75         'export_format_base.cc',
76         'export_format_manager.cc',
77         'export_format_specification.cc',
78         'export_formats.cc',
79         'export_formats_search_path.cc',
80         'export_graph_builder.cc',
81         'export_handler.cc',
82         'export_preset.cc',
83         'export_profile_manager.cc',
84         'export_status.cc',
85         'export_timespan.cc',
86         'file_source.cc',
87         'filename_extensions.cc',
88         'filesystem_paths.cc',
89         'filter.cc',
90         'find_session.cc',
91         'globals.cc',
92         'graph.cc',
93         'graphnode.cc',
94         'import.cc',
95         'instrument_info.cc',
96         'internal_return.cc',
97         'internal_send.cc',
98         'interpolation.cc',
99         'io.cc',
100         'io_processor.cc',
101         'jack_slave.cc',
102         'kmeterdsp.cc',
103         'ladspa_plugin.cc',
104         'location.cc',
105         'location_importer.cc',
106         'ltc_slave.cc',
107         'lv2_bundled_search_path.cc',
108         'meter.cc',
109         'midi_automation_list_binder.cc',
110         'midi_buffer.cc',
111         'midi_clock_slave.cc',
112         'midi_diskstream.cc',
113         'midi_model.cc',
114         'midi_patch_manager.cc',
115         'midi_patch_search_path.cc',
116         'midi_playlist.cc',
117         'midi_playlist_source.cc',
118         'midi_port.cc',
119         'midi_region.cc',
120         'midi_ring_buffer.cc',
121         'midi_source.cc',
122         'midi_state_tracker.cc',
123         'midi_stretch.cc',
124         'midi_track.cc',
125         'midi_ui.cc',
126         'mix.cc',
127         'monitor_processor.cc',
128         'mtc_slave.cc',
129         'mtdm.cc',
130         'mute_master.cc',
131         'onset_detector.cc',
132         'operations.cc',
133         'pan_controllable.cc',
134         'pannable.cc',
135         'panner.cc',
136         'panner_manager.cc',
137         'panner_search_path.cc',
138         'panner_shell.cc',
139         'pcm_utils.cc',
140         'pi_controller.cc',
141         'playlist.cc',
142         'playlist_factory.cc',
143         'playlist_source.cc',
144         'plugin.cc',
145         'plugin_insert.cc',
146         'plugin_manager.cc',
147         'port.cc',
148         'port_insert.cc',
149         'port_set.cc',
150         'process_thread.cc',
151         'processor.cc',
152         'progress.cc',
153         'quantize.cc',
154         'rc_configuration.cc',
155         'recent_sessions.cc',
156         'region_factory.cc',
157         'resampled_source.cc',
158         'region.cc',
159         'return.cc',
160         'reverse.cc',
161         'route.cc',
162         'route_graph.cc',
163         'route_group.cc',
164         'route_group_member.cc',
165         'rb_effect.cc',
166         'send.cc',
167         'session.cc',
168         'session_butler.cc',
169         'session_click.cc',
170         'session_command.cc',
171         'session_configuration.cc',
172         'session_directory.cc',
173         'session_events.cc',
174         'session_export.cc',
175         'session_handle.cc',
176         'session_ltc.cc',
177         'session_metadata.cc',
178         'session_midi.cc',
179         'session_object.cc',
180         'session_playlists.cc',
181         'session_process.cc',
182         'session_rtevents.cc',
183         'session_state.cc',
184         'session_state_utils.cc',
185         'session_time.cc',
186         'session_transport.cc',
187         'slave.cc',
188         'smf_source.cc',
189         'sndfile_helpers.cc',
190         'sndfileimportable.cc',
191         'sndfilesource.cc',
192         'source.cc',
193         'source_factory.cc',
194         'speakers.cc',
195         'strip_silence.cc',
196         'revision.cc',
197         'tape_file_matcher.cc',
198         'template_utils.cc',
199         'tempo.cc',
200         'tempo_map_importer.cc',
201         'thread_buffers.cc',
202         'ticker.cc',
203         'track.cc',
204         'transient_detector.cc',
205         'unknown_processor.cc',
206         'user_bundle.cc',
207         'utils.cc',
208         'version.cc',
209         'worker.cc'
210 ]
211
212 def flac_supported():
213     cmd = subprocess.Popen ("sndfile-info testfile.flac",
214                             stdout = subprocess.PIPE,
215                             stderr = subprocess.STDOUT, shell = True)
216     out = cmd.communicate()[0].decode('utf-8');
217     return re.search ('unknown format', out) == None
218
219 def ogg_supported():
220     cmd = subprocess.Popen ("sndfile-info testfile.ogg",
221                             stdout = subprocess.PIPE,
222                             stderr = subprocess.STDOUT, shell = True)
223     out = cmd.communicate()[0].decode('utf-8');
224     return re.search ('unknown format', out) == None
225
226 def options(opt):
227     autowaf.set_options(opt)
228
229 def configure(conf):
230     conf.load('compiler_cxx')
231     conf.load('gas')
232     # we don't use hard-coded micro versions with ardour, so hard code it to zero
233     autowaf.build_version_files(
234         path_prefix + 'ardour/version.h',
235         path_prefix + 'version.cc',
236         'libardour3', conf.env['MAJOR'], conf.env['MINOR'], 0)
237     autowaf.configure(conf)
238     autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO',
239                       atleast_version='0.3.2')
240     autowaf.check_pkg(conf, 'jack', uselib_store='JACK',
241                       atleast_version='0.118.2')
242     autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
243     autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF',
244                       atleast_version='0.4.0')
245     autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE',
246                       atleast_version='0.1.0')
247     autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP',
248                       atleast_version='2.0')
249     if Options.options.lv2:
250         autowaf.check_pkg(conf, 'lv2', uselib_store='LV2',
251                           atleast_version='1.0.0', mandatory=True)
252         autowaf.check_pkg(conf, 'lv2', uselib_store='NEW_LV2',
253                           atleast_version='1.0.15', mandatory=False)
254         autowaf.check_pkg(conf, 'serd-0', uselib_store='SERD',
255                           atleast_version='0.14.0', mandatory=True)
256         autowaf.check_pkg(conf, 'sord-0', uselib_store='SORD',
257                           atleast_version='0.8.0', mandatory=True)
258         autowaf.check_pkg(conf, 'sratom-0', uselib_store='SRATOM',
259                           atleast_version='0.2.0', mandatory=True)
260         autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
261                           atleast_version='0.14.0', mandatory=True)
262         autowaf.check_pkg(conf, 'lilv-0', uselib_store='NEW_LILV',
263                           atleast_version='0.15.0', mandatory=False)
264         autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
265                           atleast_version='0.6.0', mandatory=False)
266         conf.define ('LV2_SUPPORT', 1)
267
268 #    autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
269 #                      mandatory=False)
270     autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
271                       atleast_version='1.12.0', mandatory=False)
272     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
273     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
274                       atleast_version='1.2.1')
275     autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
276                       atleast_version='7.0.0')
277
278     # we don't try to detect this, since its part of our source tree
279
280     conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
281     conf.define('USE_RUBBERBAND', 1)  # controls whether we actually use it
282
283     conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
284
285     conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
286     conf.check(header_name='sys/statvfs.h', define_name='HAVE_SYS_STATVFS_H',mandatory=False)
287
288     conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
289                define_name='HAVE_JACK_SESSION')
290
291     conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
292
293     conf.check_cc(fragment = '''
294 #include <jack/jack.h>
295 void callback(jack_status_t code, const char* reason, void* arg) { return; }
296 int main(int argc, char **argv) {
297     jack_client_t* c;
298     jack_on_info_shutdown(c, callback, (void*) 0);
299     return 0;
300 }''',
301                   uselib= [ 'JACK' ],
302                   msg = 'Checking for jack_on_info_shutdown',
303                   define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
304                   okmsg = 'present')
305
306     missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
307
308     conf.check_cc(fragment = '''
309 #include <jack/jack.h>
310 int main(int argc, char **argv) {
311     jack_port_t* p;
312     jack_latency_range_t r;
313     jack_port_set_latency_range(p, JackCaptureLatency, &r);
314     return 0;
315 }''',
316                   uselib = [ 'JACK' ],
317                   msg = 'Checking for new JACK latency API',
318                   okmsg = 'present',
319                   mandatory = True,
320                   errmsg = missing_jack_message)
321
322     conf.check_cc(fragment = '''
323 #include <jack/jack.h>
324 int main(int argc, char **argv) {
325    jack_port_type_get_buffer_size((jack_client_t*)0, "");
326    return 0;
327 }''',
328                   uselib = [ 'JACK' ],
329                   msg = 'Checking for new jack_port_type_get_buffer_size',
330                   okmsg = 'present',
331                   mandatory = True,
332                   errmsg = missing_jack_message)
333
334     conf.check_cc(fragment = '''
335 #include <jack/transport.h>
336 int main(int argc, char** argv) {
337   jack_position_t pos;
338   pos.valid & JackVideoFrameOffset;
339   return 0;
340 }''',
341                   uselib= [ 'JACK' ],
342                   msg = 'Checking for JackVideoFrameOffset',
343                   define_name = 'HAVE_JACK_VIDEO_SUPPORT',
344                   mandatory = False,
345                   okmsg = 'present')
346
347     if flac_supported():
348         conf.define ('HAVE_FLAC', 1)
349     if ogg_supported():
350         conf.define ('HAVE_OGG', 1)
351
352     conf.write_config_header('libardour-config.h', remove=False)
353
354     # Boost headers
355     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
356     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
357     autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
358     autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
359
360
361 def build(bld):
362     # Library version (UNIX style major, minor, micro)
363     # major increment <=> incompatible changes
364     # minor increment <=> compatible changes (additions)
365     # micro increment <=> no interface changes
366     LIBARDOUR_LIB_VERSION = "3.0.0."
367
368     # Library
369     if bld.is_defined ('INTERNAL_SHARED_LIBS'):
370         obj              = bld.shlib(features = 'c cxx cshlib cxxshlib', source=libardour_sources)
371     else:
372         obj              = bld.stlib(features = 'c cxx cstlib cxxstlib', source=libardour_sources)
373         obj.cxxflags     = [ '-fPIC' ]
374         obj.cflags       = [ '-fPIC' ]
375
376     obj.export_includes = ['.']
377     obj.includes     = ['.', '../surfaces/control_protocol', '..']
378     obj.name         = 'ardour'
379     obj.target       = 'ardour'
380     obj.uselib       = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
381                         'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
382                         'OSX','BOOST','CURL','DL']
383     obj.use          = ['libpbd','libmidipp','libevoral','libvamphost',
384                         'libvampplugin','libtaglib','librubberband',
385                         'libaudiographer','libltc']
386     obj.vnum         = LIBARDOUR_LIB_VERSION
387     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
388     obj.defines      = [
389         'PACKAGE="' + I18N_PACKAGE + '"',
390         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
391         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
392         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
393         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"',
394         'EVORAL_MIDI_XML=1' 
395         ]
396
397     #obj.source += ' st_stretch.cc st_pitch.cc '
398     #obj.uselib += ' SOUNDTOUCH '
399     #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
400
401     if bld.is_defined('HAVE_LILV') :
402         obj.source += ['lv2_plugin.cc', 'lv2_evbuf.c', 'uri_map.cc'] 
403         obj.uselib += ['LILV']
404         if bld.is_defined('HAVE_SUIL'):
405             obj.uselib += ['SUIL']
406
407     if bld.is_defined('WINDOWS_VST_SUPPORT'):
408         obj.source += [ 'windows_vst_plugin.cc']
409         obj.includes += [ '../fst' ]
410         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
411
412     if bld.is_defined('LXVST_SUPPORT'):
413         obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc', 'linux_vst_info_file.cc' ]
414         obj.defines += [ 'LXVST_SUPPORT' ]
415
416     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
417         obj.source += [ 'session_vst.cc', 'vst_plugin.cc' ]
418
419     if bld.is_defined('HAVE_COREAUDIO'):
420         obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
421         obj.use    += ['libappleutility']
422
423     if bld.is_defined('AUDIOUNIT_SUPPORT'):
424         obj.source += [ 'audio_unit.cc' ]
425
426     if Options.options.fpu_optimization:
427         if (bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686'):
428             obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
429         elif bld.env['build_target'] == 'x86_64':
430             obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
431
432     # i18n
433     if bld.is_defined('ENABLE_NLS'):
434         mo_files = bld.path.ant_glob('po/*.mo')
435         for mo in mo_files:
436             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
437             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
438                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
439                            mo)
440
441     if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
442         # Unit tests
443         # only build these common sources once
444         testcommon              = bld(features = 'cxx')
445         testcommon.includes     = obj.includes + ['test', '../pbd', '..']
446         testcommon.source       = ['test/test_globals.cc', 'test/testrunner.cc', 'test/test_needing_session.cc',
447                                    'test/dummy_lxvst.cc', 'test/audio_region_test.cc', 'test/test_util.cc' ]
448         testcommon.uselib       = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
449                                    'SAMPLERATE','XML','LRDF','COREAUDIO']
450         testcommon.use          = ['libpbd','libmidipp','libevoral','libvamphost',
451                                    'libvampplugin','libtaglib','librubberband',
452                                    'libaudiographer','libltc','ardour']
453         testcommon.defines      = [
454             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
455             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
456             'LOCALEDIR="' + os.path.join(
457                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
458             'VAMP_DIR="' + os.path.join(
459                 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
460             ]
461         testcommon.name         = 'testcommon'
462
463         if bld.env['FPU_OPTIMIZATION']:
464             testcommon.source += [ 'sse_functions_xmm.cc' ]
465             if (bld.env['build_target'] == 'i386'
466                 or bld.env['build_target'] == 'i686'):
467                 testcommon.source += [ 'sse_functions.s' ]
468             elif bld.env['build_target'] == 'x86_64':
469                 testcommon.source += [ 'sse_functions_64bit.s' ]
470
471         if bld.env['SINGLE_TESTS']:
472             create_ardour_test_program(bld, obj.includes, 'automation_list_property_test', 'test_automation_list_property', ['test/automation_list_property_test.cc'])
473             create_ardour_test_program(bld, obj.includes, 'bbt', 'test_bbt', ['test/bbt_test.cc'])
474             create_ardour_test_program(bld, obj.includes, 'tempo', 'test_tempo', ['test/tempo_test.cc'])
475             create_ardour_test_program(bld, obj.includes, 'interpolation', 'test_interpolation', ['test/interpolation_test.cc'])
476             create_ardour_test_program(bld, obj.includes, 'midi_clock_slave', 'test_midi_clock_slave', ['test/midi_clock_slave_test.cc'])
477             create_ardour_test_program(bld, obj.includes, 'resampled_source', 'test_resampled_source', ['test/resampled_source_test.cc'])
478             create_ardour_test_program(bld, obj.includes, 'framewalk_to_beats', 'test_framewalk_to_beats', ['test/framewalk_to_beats_test.cc'])
479             create_ardour_test_program(bld, obj.includes, 'framepos_plus_beats', 'test_framepos_plus_beats', ['test/framepos_plus_beats_test.cc'])
480             create_ardour_test_program(bld, obj.includes, 'framepos_minus_beats', 'test_framepos_minus_beats', ['test/framepos_minus_beats_test.cc'])
481             create_ardour_test_program(bld, obj.includes, 'playlist_equivalent_regions', 'test_playlist_equivalent_regions', ['test/playlist_equivalent_regions_test.cc'])
482             create_ardour_test_program(bld, obj.includes, 'playlist_layering', 'test_playlist_layering', ['test/playlist_layering_test.cc'])
483             create_ardour_test_program(bld, obj.includes, 'region_naming', 'test_region_naming', ['test/region_naming_test.cc'])
484             create_ardour_test_program(bld, obj.includes, 'control_surface', 'test_control_surfaces', ['test/control_surfaces_test.cc'])
485             create_ardour_test_program(bld, obj.includes, 'mtdm_test', 'test_mtdm', ['test/mtdm_test.cc'])
486
487         test_sources  = '''
488             test/automation_list_property_test.cc
489             test/bbt_test.cc
490             test/tempo_test.cc
491             test/interpolation_test.cc
492             test/midi_clock_slave_test.cc
493             test/resampled_source_test.cc
494             test/framewalk_to_beats_test.cc
495             test/framepos_plus_beats_test.cc
496             test/framepos_minus_beats_test.cc
497             test/playlist_equivalent_regions_test.cc
498             test/playlist_layering_test.cc
499             test/region_naming_test.cc
500             test/control_surfaces_test.cc
501             test/mtdm_test.cc
502         '''.split()
503
504 # Tests that don't work
505 #                test/playlist_read_test.cc
506 #                test/audio_region_read_test.cc
507 #                test/combine_regions_test.cc
508 #                test/mantis_3356_test.cc
509
510         create_ardour_test_program(bld, obj.includes, 'libardour-tests', 'run-tests', test_sources)
511
512         # Tester to just load a session
513         session_load_tester = bld(features = 'cxx cxxprogram')
514         session_load_tester.source = '''
515                     test/test_util.cc
516                     test/load_session.cc
517                     test/dummy_lxvst.cc
518             '''.split()
519
520         session_load_tester.includes  = obj.includes
521         session_load_tester.includes.append ('test')
522         session_load_tester.uselib    = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
523                              'SAMPLERATE','XML','LRDF','COREAUDIO']
524         session_load_tester.use       = ['libpbd','libmidipp','ardour']
525         session_load_tester.name      = 'libardour-session-load-tester'
526         session_load_tester.target    = 'load-session'
527         session_load_tester.install_path = ''
528         session_load_tester.defines      = [
529             'PACKAGE="libardour3profile"',
530             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
531             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
532             'LOCALEDIR="' + os.path.join(
533                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
534             'VAMP_DIR="' + os.path.join(
535                 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
536             ]
537         if bld.env['FPU_OPTIMIZATION']:
538             session_load_tester.source += [ 'sse_functions_xmm.cc' ]
539             if (bld.env['build_target'] == 'i386'
540                 or bld.env['build_target'] == 'i686'):
541                 session_load_tester.source += [ 'sse_functions.s' ]
542             elif bld.env['build_target'] == 'x86_64':
543                 session_load_tester.source += [ 'sse_functions_64bit.s' ]
544
545         # Profiling
546         for p in ['runpc', 'lots_of_regions', 'load_session']:
547             profilingobj = bld(features = 'cxx cxxprogram')
548             profilingobj.source = '''
549                     test/dummy_lxvst.cc
550                     test/test_util.cc
551             '''.split()
552
553             profilingobj.source.append('test/profiling/%s.cc' % p)
554
555             profilingobj.includes  = obj.includes
556             profilingobj.includes.append ('test')
557             profilingobj.uselib    = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
558                              'SAMPLERATE','XML','LRDF','COREAUDIO']
559             profilingobj.use       = ['libpbd','libmidipp','ardour']
560             profilingobj.name      = 'libardour-profiling'
561             profilingobj.target    = p
562             profilingobj.install_path = ''
563             profilingobj.defines      = [
564                 'PACKAGE="libardour3profile"',
565                 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
566                 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
567                 'LOCALEDIR="' + os.path.join(
568                     os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
569                 'VAMP_DIR="' + os.path.join(
570                     os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
571                 ]
572             if bld.env['FPU_OPTIMIZATION']:
573                 profilingobj.source += [ 'sse_functions_xmm.cc' ]
574                 if (bld.env['build_target'] == 'i386'
575                     or bld.env['build_target'] == 'i686'):
576                     profilingobj.source += [ 'sse_functions.s' ]
577                 elif bld.env['build_target'] == 'x86_64':
578                     profilingobj.source += [ 'sse_functions_64bit.s' ]
579
580 def create_ardour_test_program(bld, includes, name, target, sources):
581     testobj              = bld(features = 'cxx cxxprogram')
582     testobj.includes     = includes + ['test', '../pbd', '..']
583     testobj.source       = sources
584     testobj.uselib       = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
585                             'SAMPLERATE','XML','LRDF','COREAUDIO']
586     testobj.use          = ['libpbd','libmidipp','libevoral','libvamphost',
587                             'libvampplugin','libtaglib','librubberband',
588                             'libaudiographer','libltc','ardour','testcommon']
589     testobj.name         = name
590     testobj.target       = target
591     # not sure about install path
592     testobj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
593     testobj.defines      = [
594         'PACKAGE="libardour3test"',
595         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
596         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
597         'LOCALEDIR="' + os.path.join(
598             os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
599         'VAMP_DIR="' + os.path.join(
600             os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
601         ]
602
603 def shutdown():
604     autowaf.shutdown()
605
606 def i18n(bld):
607     autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
608                        'Paul Davis')
609
610 def i18n_pot(bld):
611     autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
612                        'Paul Davis')
613
614 def i18n_po(bld):
615     autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
616                        'Paul Davis')
617
618 def i18n_mo(bld):
619     autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
620                        'Paul Davis')