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