Revert "Revert new meter types (postponed until after 3.3 release)"
[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         'iec1ppmdsp.cc',
95         'iec2ppmdsp.cc',
96         'import.cc',
97         'instrument_info.cc',
98         'internal_return.cc',
99         'internal_send.cc',
100         'interpolation.cc',
101         'io.cc',
102         'io_processor.cc',
103         'jack_slave.cc',
104         'kmeterdsp.cc',
105         'ladspa_plugin.cc',
106         'location.cc',
107         'location_importer.cc',
108         'ltc_slave.cc',
109         'lv2_bundled_search_path.cc',
110         'meter.cc',
111         'midi_automation_list_binder.cc',
112         'midi_buffer.cc',
113         'midi_clock_slave.cc',
114         'midi_diskstream.cc',
115         'midi_model.cc',
116         'midi_patch_manager.cc',
117         'midi_patch_search_path.cc',
118         'midi_playlist.cc',
119         'midi_playlist_source.cc',
120         'midi_port.cc',
121         'midi_region.cc',
122         'midi_ring_buffer.cc',
123         'midi_source.cc',
124         'midi_state_tracker.cc',
125         'midi_stretch.cc',
126         'midi_track.cc',
127         'midi_ui.cc',
128         'mix.cc',
129         'monitor_processor.cc',
130         'mtc_slave.cc',
131         'mtdm.cc',
132         'mute_master.cc',
133         'onset_detector.cc',
134         'operations.cc',
135         'pan_controllable.cc',
136         'pannable.cc',
137         'panner.cc',
138         'panner_manager.cc',
139         'panner_search_path.cc',
140         'panner_shell.cc',
141         'pcm_utils.cc',
142         'pi_controller.cc',
143         'playlist.cc',
144         'playlist_factory.cc',
145         'playlist_source.cc',
146         'plugin.cc',
147         'plugin_insert.cc',
148         'plugin_manager.cc',
149         'port.cc',
150         'port_insert.cc',
151         'port_set.cc',
152         'process_thread.cc',
153         'processor.cc',
154         'progress.cc',
155         'quantize.cc',
156         'rc_configuration.cc',
157         'recent_sessions.cc',
158         'region_factory.cc',
159         'resampled_source.cc',
160         'region.cc',
161         'return.cc',
162         'reverse.cc',
163         'route.cc',
164         'route_graph.cc',
165         'route_group.cc',
166         'route_group_member.cc',
167         'rb_effect.cc',
168         'send.cc',
169         'session.cc',
170         'session_butler.cc',
171         'session_click.cc',
172         'session_command.cc',
173         'session_configuration.cc',
174         'session_directory.cc',
175         'session_events.cc',
176         'session_export.cc',
177         'session_handle.cc',
178         'session_ltc.cc',
179         'session_metadata.cc',
180         'session_midi.cc',
181         'session_object.cc',
182         'session_playlists.cc',
183         'session_process.cc',
184         'session_rtevents.cc',
185         'session_state.cc',
186         'session_state_utils.cc',
187         'session_time.cc',
188         'session_transport.cc',
189         'slave.cc',
190         'smf_source.cc',
191         'sndfile_helpers.cc',
192         'sndfileimportable.cc',
193         'sndfilesource.cc',
194         'source.cc',
195         'source_factory.cc',
196         'speakers.cc',
197         'strip_silence.cc',
198         'revision.cc',
199         'tape_file_matcher.cc',
200         'template_utils.cc',
201         'tempo.cc',
202         'tempo_map_importer.cc',
203         'thread_buffers.cc',
204         'ticker.cc',
205         'track.cc',
206         'transient_detector.cc',
207         'unknown_processor.cc',
208         'user_bundle.cc',
209         'utils.cc',
210         'version.cc',
211         'vumeterdsp.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     autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
246     autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF',
247                       atleast_version='0.4.0')
248     autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE',
249                       atleast_version='0.1.0')
250     autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP',
251                       atleast_version='2.0')
252     if Options.options.lv2:
253         autowaf.check_pkg(conf, 'lv2', uselib_store='LV2',
254                           atleast_version='1.0.0', mandatory=True)
255         autowaf.check_pkg(conf, 'lv2', uselib_store='NEW_LV2',
256                           atleast_version='1.0.15', mandatory=False)
257         autowaf.check_pkg(conf, 'serd-0', uselib_store='SERD',
258                           atleast_version='0.14.0', mandatory=True)
259         autowaf.check_pkg(conf, 'sord-0', uselib_store='SORD',
260                           atleast_version='0.8.0', mandatory=True)
261         autowaf.check_pkg(conf, 'sratom-0', uselib_store='SRATOM',
262                           atleast_version='0.2.0', mandatory=True)
263         autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
264                           atleast_version='0.14.0', mandatory=True)
265         autowaf.check_pkg(conf, 'lilv-0', uselib_store='NEW_LILV',
266                           atleast_version='0.15.0', mandatory=False)
267         autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
268                           atleast_version='0.6.0', mandatory=False)
269         conf.define ('LV2_SUPPORT', 1)
270
271 #    autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
272 #                      mandatory=False)
273     autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
274                       atleast_version='1.12.0', mandatory=False)
275     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
276     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
277                       atleast_version='1.2.1')
278     autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
279                       atleast_version='7.0.0')
280
281     # we don't try to detect this, since its part of our source tree
282
283     conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
284     conf.define('USE_RUBBERBAND', 1)  # controls whether we actually use it
285
286     conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
287
288     conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
289     conf.check(header_name='sys/statvfs.h', define_name='HAVE_SYS_STATVFS_H',mandatory=False)
290
291     conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
292                define_name='HAVE_JACK_SESSION')
293
294     conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
295
296     conf.check_cc(fragment = '''
297 #include <jack/jack.h>
298 void callback(jack_status_t code, const char* reason, void* arg) { return; }
299 int main(int argc, char **argv) {
300     jack_client_t* c;
301     jack_on_info_shutdown(c, callback, (void*) 0);
302     return 0;
303 }''',
304                   uselib= [ 'JACK' ],
305                   msg = 'Checking for jack_on_info_shutdown',
306                   define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
307                   okmsg = 'present')
308
309     missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
310
311     conf.check_cc(fragment = '''
312 #include <jack/jack.h>
313 int main(int argc, char **argv) {
314     jack_port_t* p;
315     jack_latency_range_t r;
316     jack_port_set_latency_range(p, JackCaptureLatency, &r);
317     return 0;
318 }''',
319                   uselib = [ 'JACK' ],
320                   msg = 'Checking for new JACK latency API',
321                   okmsg = 'present',
322                   mandatory = True,
323                   errmsg = missing_jack_message)
324
325     conf.check_cc(fragment = '''
326 #include <jack/jack.h>
327 int main(int argc, char **argv) {
328    jack_port_type_get_buffer_size((jack_client_t*)0, "");
329    return 0;
330 }''',
331                   uselib = [ 'JACK' ],
332                   msg = 'Checking for new jack_port_type_get_buffer_size',
333                   okmsg = 'present',
334                   mandatory = True,
335                   errmsg = missing_jack_message)
336
337     conf.check_cc(fragment = '''
338 #include <jack/transport.h>
339 int main(int argc, char** argv) {
340   jack_position_t pos;
341   pos.valid & JackVideoFrameOffset;
342   return 0;
343 }''',
344                   uselib= [ 'JACK' ],
345                   msg = 'Checking for JackVideoFrameOffset',
346                   define_name = 'HAVE_JACK_VIDEO_SUPPORT',
347                   mandatory = False,
348                   okmsg = 'present')
349
350     if flac_supported():
351         conf.define ('HAVE_FLAC', 1)
352     if ogg_supported():
353         conf.define ('HAVE_OGG', 1)
354
355     conf.write_config_header('libardour-config.h', remove=False)
356
357     # Boost headers
358     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
359     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
360     autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
361     autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
362
363
364 def build(bld):
365     # Library version (UNIX style major, minor, micro)
366     # major increment <=> incompatible changes
367     # minor increment <=> compatible changes (additions)
368     # micro increment <=> no interface changes
369     LIBARDOUR_LIB_VERSION = "3.0.0."
370
371     # Library
372     if bld.is_defined ('INTERNAL_SHARED_LIBS'):
373         obj              = bld.shlib(features = 'c cxx cshlib cxxshlib', source=libardour_sources)
374     else:
375         obj              = bld.stlib(features = 'c cxx cstlib cxxstlib', source=libardour_sources)
376         obj.cxxflags     = [ '-fPIC' ]
377         obj.cflags       = [ '-fPIC' ]
378
379     obj.export_includes = ['.']
380     obj.includes     = ['.', '../surfaces/control_protocol', '..']
381     obj.name         = 'ardour'
382     obj.target       = 'ardour'
383     obj.uselib       = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
384                         'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
385                         'OSX','BOOST','CURL','DL']
386     obj.use          = ['libpbd','libmidipp','libevoral','libvamphost',
387                         'libvampplugin','libtaglib','librubberband',
388                         'libaudiographer','libltc']
389     obj.vnum         = LIBARDOUR_LIB_VERSION
390     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
391     obj.defines      = [
392         'PACKAGE="' + I18N_PACKAGE + '"',
393         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
394         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
395         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
396         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"',
397         'EVORAL_MIDI_XML=1' 
398         ]
399
400     #obj.source += ' st_stretch.cc st_pitch.cc '
401     #obj.uselib += ' SOUNDTOUCH '
402     #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
403
404     if bld.is_defined('HAVE_LILV') :
405         obj.source += ['lv2_plugin.cc', 'lv2_evbuf.c', 'uri_map.cc'] 
406         obj.uselib += ['LILV']
407         if bld.is_defined('HAVE_SUIL'):
408             obj.uselib += ['SUIL']
409
410     if bld.is_defined('WINDOWS_VST_SUPPORT'):
411         obj.source += [ 'windows_vst_plugin.cc']
412         obj.includes += [ '../fst' ]
413         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
414
415     if bld.is_defined('LXVST_SUPPORT'):
416         obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc', 'linux_vst_info_file.cc' ]
417         obj.defines += [ 'LXVST_SUPPORT' ]
418
419     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
420         obj.source += [ 'session_vst.cc', 'vst_plugin.cc' ]
421
422     if bld.is_defined('HAVE_COREAUDIO'):
423         obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
424         obj.use    += ['libappleutility']
425
426     if bld.is_defined('AUDIOUNIT_SUPPORT'):
427         obj.source += [ 'audio_unit.cc' ]
428
429     if Options.options.fpu_optimization:
430         if (bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686'):
431             obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
432         elif bld.env['build_target'] == 'x86_64':
433             obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
434
435     # i18n
436     if bld.is_defined('ENABLE_NLS'):
437         mo_files = bld.path.ant_glob('po/*.mo')
438         for mo in mo_files:
439             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
440             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
441                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
442                            mo)
443
444     if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
445         # Unit tests
446         # only build these common sources once
447         testcommon              = bld(features = 'cxx')
448         testcommon.includes     = obj.includes + ['test', '../pbd', '..']
449         testcommon.source       = ['test/test_globals.cc', 'test/testrunner.cc', 'test/test_needing_session.cc',
450                                    'test/test_common.cc', 'test/dummy_lxvst.cc', 'test/audio_region_test.cc', 'test/test_util.cc']
451         testcommon.uselib       = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
452                                    'SAMPLERATE','XML','LRDF','COREAUDIO']
453         testcommon.use          = ['libpbd','libmidipp','libevoral','libvamphost',
454                                    'libvampplugin','libtaglib','librubberband',
455                                    'libaudiographer','libltc','ardour']
456         testcommon.defines      = [
457             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
458             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
459             'LOCALEDIR="' + os.path.join(
460                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
461             'VAMP_DIR="' + os.path.join(
462                 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
463             ]
464         testcommon.name         = 'testcommon'
465
466         if bld.env['FPU_OPTIMIZATION']:
467             testcommon.source += [ 'sse_functions_xmm.cc' ]
468             if (bld.env['build_target'] == 'i386'
469                 or bld.env['build_target'] == 'i686'):
470                 testcommon.source += [ 'sse_functions.s' ]
471             elif bld.env['build_target'] == 'x86_64':
472                 testcommon.source += [ 'sse_functions_64bit.s' ]
473
474         if bld.env['SINGLE_TESTS']:
475             create_ardour_test_program(bld, obj.includes, 'automation_list_property_test', 'test_automation_list_property', ['test/automation_list_property_test.cc'])
476             create_ardour_test_program(bld, obj.includes, 'bbt', 'test_bbt', ['test/bbt_test.cc'])
477             create_ardour_test_program(bld, obj.includes, 'tempo', 'test_tempo', ['test/tempo_test.cc'])
478             create_ardour_test_program(bld, obj.includes, 'interpolation', 'test_interpolation', ['test/interpolation_test.cc'])
479             create_ardour_test_program(bld, obj.includes, 'midi_clock_slave', 'test_midi_clock_slave', ['test/midi_clock_slave_test.cc'])
480             create_ardour_test_program(bld, obj.includes, 'resampled_source', 'test_resampled_source', ['test/resampled_source_test.cc'])
481             create_ardour_test_program(bld, obj.includes, 'framewalk_to_beats', 'test_framewalk_to_beats', ['test/framewalk_to_beats_test.cc'])
482             create_ardour_test_program(bld, obj.includes, 'framepos_plus_beats', 'test_framepos_plus_beats', ['test/framepos_plus_beats_test.cc'])
483             create_ardour_test_program(bld, obj.includes, 'framepos_minus_beats', 'test_framepos_minus_beats', ['test/framepos_minus_beats_test.cc'])
484             create_ardour_test_program(bld, obj.includes, 'playlist_equivalent_regions', 'test_playlist_equivalent_regions', ['test/playlist_equivalent_regions_test.cc'])
485             create_ardour_test_program(bld, obj.includes, 'playlist_layering', 'test_playlist_layering', ['test/playlist_layering_test.cc'])
486             create_ardour_test_program(bld, obj.includes, 'region_naming', 'test_region_naming', ['test/region_naming_test.cc'])
487             create_ardour_test_program(bld, obj.includes, 'control_surface', 'test_control_surfaces', ['test/control_surfaces_test.cc'])
488             create_ardour_test_program(bld, obj.includes, 'mtdm_test', 'test_mtdm', ['test/mtdm_test.cc'])
489             create_ardour_test_program(bld, obj.includes, 'session_test', 'test_session', ['test/session_test.cc'])
490
491         test_sources  = '''
492             test/automation_list_property_test.cc
493             test/bbt_test.cc
494             test/tempo_test.cc
495             test/interpolation_test.cc
496             test/midi_clock_slave_test.cc
497             test/resampled_source_test.cc
498             test/framewalk_to_beats_test.cc
499             test/framepos_plus_beats_test.cc
500             test/framepos_minus_beats_test.cc
501             test/playlist_equivalent_regions_test.cc
502             test/playlist_layering_test.cc
503             test/region_naming_test.cc
504             test/control_surfaces_test.cc
505             test/mtdm_test.cc
506             test/session_test.cc
507         '''.split()
508
509 # Tests that don't work
510 #                test/playlist_read_test.cc
511 #                test/audio_region_read_test.cc
512 #                test/combine_regions_test.cc
513 #                test/mantis_3356_test.cc
514
515         create_ardour_test_program(bld, obj.includes, 'libardour-tests', 'run-tests', test_sources)
516
517         # Tester to just load a session
518         session_load_tester = bld(features = 'cxx cxxprogram')
519         session_load_tester.source = '''
520                     test/test_util.cc
521                     test/load_session.cc
522                     test/dummy_lxvst.cc
523             '''.split()
524
525         session_load_tester.includes  = obj.includes
526         session_load_tester.includes.append ('test')
527         session_load_tester.uselib    = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
528                              'SAMPLERATE','XML','LRDF','COREAUDIO']
529         session_load_tester.use       = ['libpbd','libmidipp','ardour']
530         session_load_tester.name      = 'libardour-session-load-tester'
531         session_load_tester.target    = 'load-session'
532         session_load_tester.install_path = ''
533         session_load_tester.defines      = [
534             'PACKAGE="libardour3profile"',
535             'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
536             'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
537             'LOCALEDIR="' + os.path.join(
538                 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
539             'VAMP_DIR="' + os.path.join(
540                 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
541             ]
542         if bld.env['FPU_OPTIMIZATION']:
543             session_load_tester.source += [ 'sse_functions_xmm.cc' ]
544             if (bld.env['build_target'] == 'i386'
545                 or bld.env['build_target'] == 'i686'):
546                 session_load_tester.source += [ 'sse_functions.s' ]
547             elif bld.env['build_target'] == 'x86_64':
548                 session_load_tester.source += [ 'sse_functions_64bit.s' ]
549
550         # Profiling
551         for p in ['runpc', 'lots_of_regions', 'load_session']:
552             profilingobj = bld(features = 'cxx cxxprogram')
553             profilingobj.source = '''
554                     test/dummy_lxvst.cc
555                     test/test_util.cc
556             '''.split()
557
558             profilingobj.source.append('test/profiling/%s.cc' % p)
559
560             profilingobj.includes  = obj.includes
561             profilingobj.includes.append ('test')
562             profilingobj.uselib    = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
563                              'SAMPLERATE','XML','LRDF','COREAUDIO']
564             profilingobj.use       = ['libpbd','libmidipp','ardour']
565             profilingobj.name      = 'libardour-profiling'
566             profilingobj.target    = p
567             profilingobj.install_path = ''
568             profilingobj.defines      = [
569                 'PACKAGE="libardour3profile"',
570                 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
571                 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
572                 'LOCALEDIR="' + os.path.join(
573                     os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
574                 'VAMP_DIR="' + os.path.join(
575                     os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
576                 ]
577             if bld.env['FPU_OPTIMIZATION']:
578                 profilingobj.source += [ 'sse_functions_xmm.cc' ]
579                 if (bld.env['build_target'] == 'i386'
580                     or bld.env['build_target'] == 'i686'):
581                     profilingobj.source += [ 'sse_functions.s' ]
582                 elif bld.env['build_target'] == 'x86_64':
583                     profilingobj.source += [ 'sse_functions_64bit.s' ]
584
585 def create_ardour_test_program(bld, includes, name, target, sources):
586     testobj              = bld(features = 'cxx cxxprogram')
587     testobj.includes     = includes + ['test', '../pbd', '..']
588     testobj.source       = sources
589     testobj.uselib       = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
590                             'SAMPLERATE','XML','LRDF','COREAUDIO']
591     testobj.use          = ['libpbd','libmidipp','libevoral','libvamphost',
592                             'libvampplugin','libtaglib','librubberband',
593                             'libaudiographer','libltc','ardour','testcommon']
594     testobj.name         = name
595     testobj.target       = target
596     # not sure about install path
597     testobj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
598     testobj.defines      = [
599         'PACKAGE="libardour3test"',
600         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
601         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
602         'LOCALEDIR="' + os.path.join(
603             os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
604         'VAMP_DIR="' + os.path.join(
605             os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
606         ]
607
608 def shutdown():
609     autowaf.shutdown()
610
611 def i18n(bld):
612     autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
613                        'Paul Davis')
614
615 def i18n_pot(bld):
616     autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
617                        'Paul Davis')
618
619 def i18n_po(bld):
620     autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
621                        'Paul Davis')
622
623 def i18n_mo(bld):
624     autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
625                        'Paul Davis')