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