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