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