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