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