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