2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
8 # Version of this package (even if built as a child)
12 LIBARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
14 # Library version (UNIX style major, minor, micro)
15 # major increment <=> incompatible changes
16 # minor increment <=> compatible changes (additions)
17 # micro increment <=> no interface changes
18 LIBARDOUR_LIB_VERSION = '3.0.0'
20 # default state file version for this build
21 CURRENT_SESSION_FILE_VERSION = 3001
23 # Variables for 'waf dist'
24 APPNAME = 'libardour3'
25 VERSION = LIBARDOUR_VERSION
26 I18N_PACKAGE = 'libardour3'
32 path_prefix = 'libs/ardour/'
38 'audio_diskstream.cc',
41 'audio_playlist_importer.cc',
42 'audio_playlist_source.cc',
44 'audio_region_importer.cc',
46 'audio_track_importer.cc',
49 'audiofile_tagger.cc',
56 'automation_control.cc',
58 'beats_frames_converter.cc',
66 'capturing_processor.cc',
71 'control_protocol_manager.cc',
72 'control_protocol_search_path.cc',
80 'element_import_handler.cc',
81 'element_importer.cc',
85 'export_channel_configuration.cc',
88 'export_format_base.cc',
89 'export_format_manager.cc',
90 'export_format_specification.cc',
92 'export_formats_search_path.cc',
93 'export_graph_builder.cc',
96 'export_profile_manager.cc',
100 'filename_extensions.cc',
101 'filesystem_paths.cc',
108 'instrument_info.cc',
109 'internal_return.cc',
117 'location_importer.cc',
119 'midi_automation_list_binder.cc',
121 'midi_clock_slave.cc',
122 'midi_diskstream.cc',
124 'midi_patch_manager.cc',
125 'midi_patch_search_path.cc',
127 'midi_playlist_source.cc',
130 'midi_ring_buffer.cc',
132 'midi_state_tracker.cc',
137 'monitor_processor.cc',
141 'named_selection.cc',
144 'pan_controllable.cc',
148 'panner_search_path.cc',
153 'playlist_factory.cc',
154 'playlist_source.cc',
165 'rc_configuration.cc',
166 'recent_sessions.cc',
168 'resampled_source.cc',
175 'route_group_member.cc',
181 'session_command.cc',
182 'session_configuration.cc',
183 'session_directory.cc',
187 'session_metadata.cc',
190 'session_playlists.cc',
191 'session_process.cc',
192 'session_rtevents.cc',
194 'session_state_utils.cc',
196 'session_transport.cc',
200 'sndfile_helpers.cc',
201 'sndfileimportable.cc',
208 'tape_file_matcher.cc',
211 'tempo_map_importer.cc',
215 'transient_detector.cc',
216 'unknown_processor.cc',
223 def flac_supported():
224 cmd = subprocess.Popen ("sndfile-info testfile.flac",
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
231 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
232 stdout = subprocess.PIPE,
233 stderr = subprocess.STDOUT, shell = True)
234 out = cmd.communicate()[0].decode('utf-8');
235 return re.search ('unknown format', out) == None
238 autowaf.set_options(opt)
241 conf.load('compiler_cxx')
243 autowaf.build_version_files(
244 path_prefix + 'ardour/version.h',
245 path_prefix + 'version.cc',
246 'libardour3', MAJOR, MINOR, MICRO)
247 autowaf.configure(conf)
248 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO',
249 atleast_version='0.3.2')
250 autowaf.check_pkg(conf, 'jack', uselib_store='JACK',
251 atleast_version='0.118.2')
252 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
253 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF',
254 atleast_version='0.4.0')
255 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE',
256 atleast_version='0.1.0')
257 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP',
258 atleast_version='2.0')
259 if Options.options.lv2:
260 autowaf.check_pkg(conf, 'lv2', uselib_store='LV2',
261 atleast_version='1.0.0', mandatory=True)
262 autowaf.check_pkg(conf, 'serd-0', uselib_store='SERD',
263 atleast_version='0.14.0', mandatory=True)
264 autowaf.check_pkg(conf, 'sord-0', uselib_store='SORD',
265 atleast_version='0.8.0', mandatory=True)
266 autowaf.check_pkg(conf, 'sratom-0', uselib_store='SRATOM',
267 atleast_version='0.2.0', mandatory=True)
268 autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
269 atleast_version='0.14.0', mandatory=True)
270 autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
271 atleast_version='0.6.0', mandatory=False)
272 conf.define ('LV2_SUPPORT', 1)
274 # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
276 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
277 atleast_version='1.12.0', mandatory=False)
278 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
279 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
280 atleast_version='1.2.1')
281 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
282 atleast_version='7.0.0')
284 # we don't try to detect this, since its part of our source tree
286 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
287 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
289 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
291 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
292 conf.check(header_name='sys/statvfs.h', define_name='HAVE_SYS_STATVFS_H',mandatory=False)
294 conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
295 define_name='HAVE_JACK_SESSION')
297 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
299 conf.check_cc(fragment = '''
300 #include <jack/jack.h>
301 void callback(jack_status_t code, const char* reason, void* arg) { return; }
302 int main(int argc, char **argv) {
304 jack_on_info_shutdown(c, callback, (void*) 0);
308 msg = 'Checking for jack_on_info_shutdown',
309 define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
312 missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
314 conf.check_cc(fragment = '''
315 #include <jack/jack.h>
316 int main(int argc, char **argv) {
318 jack_latency_range_t r;
319 jack_port_set_latency_range(p, JackCaptureLatency, &r);
323 msg = 'Checking for new JACK latency API',
326 errmsg = missing_jack_message)
328 conf.check_cc(fragment = '''
329 #include <jack/jack.h>
330 int main(int argc, char **argv) {
331 jack_port_type_get_buffer_size((jack_client_t*)0, "");
335 msg = 'Checking for new jack_port_type_get_buffer_size',
338 errmsg = missing_jack_message)
341 conf.define ('HAVE_FLAC', 1)
343 conf.define ('HAVE_OGG', 1)
345 conf.write_config_header('libardour-config.h', remove=False)
348 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
349 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
350 autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
351 autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
356 obj = bld(features = 'c cxx cshlib cxxshlib')
357 obj.source = libardour_sources
358 obj.export_includes = ['.']
359 obj.includes = ['.', '../surfaces/control_protocol', '..']
360 obj.name = 'libardour'
361 obj.target = 'ardour'
362 obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
363 'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
364 'OSX','BOOST','CURL','DL']
365 obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
366 'libvampplugin','libtaglib','librubberband',
368 obj.vnum = LIBARDOUR_LIB_VERSION
369 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
371 'PACKAGE="' + I18N_PACKAGE + '"',
372 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
373 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
374 'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
375 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
378 #obj.source += ' st_stretch.cc st_pitch.cc '
379 #obj.uselib += ' SOUNDTOUCH '
380 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
382 if bld.is_defined('HAVE_LILV') :
383 obj.source += ['lv2_plugin.cc', 'lv2_evbuf.c', 'uri_map.cc']
384 obj.uselib += ['LILV']
385 if bld.is_defined('HAVE_SUIL'):
386 obj.uselib += ['SUIL']
388 if bld.is_defined('WINDOWS_VST_SUPPORT'):
389 obj.source += [ 'windows_vst_plugin.cc']
390 obj.includes += [ '../fst' ]
391 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
393 if bld.is_defined('LXVST_SUPPORT'):
394 obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc', 'linux_vst_info_file.cc' ]
395 obj.defines += [ 'LXVST_SUPPORT' ]
397 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
398 obj.source += [ 'session_vst.cc', 'vst_plugin.cc' ]
400 if bld.is_defined('HAVE_COREAUDIO'):
401 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
402 obj.use += ['libappleutility']
404 if bld.is_defined('AUDIOUNIT_SUPPORT'):
405 obj.source += [ 'audio_unit.cc' ]
407 if Options.options.fpu_optimization:
408 if (bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686'):
409 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
410 elif bld.env['build_target'] == 'x86_64':
411 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
414 if bld.is_defined('ENABLE_NLS'):
415 mo_files = bld.path.ant_glob('po/*.mo')
417 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
418 bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
419 lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
422 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
424 testobj = bld(features = 'cxx cxxprogram')
428 test/test_needing_session.cc
429 test/audio_region_test.cc
431 test/audio_region_read_test.cc
432 test/automation_list_property_test.cc
435 test/interpolation_test.cc
436 test/midi_clock_slave_test.cc
437 test/resampled_source_test.cc
438 test/framewalk_to_beats_test.cc
439 test/framepos_plus_beats_test.cc
440 test/framepos_minus_beats_test.cc
441 test/playlist_layering_test.cc
442 test/playlist_read_test.cc
443 test/playlist_equivalent_regions_test.cc
444 test/control_surfaces_test.cc
445 test/combine_regions_test.cc
446 test/region_naming_test.cc
451 # Tests that don't work
452 # test/mantis_3356_test.cc
454 testobj.includes = obj.includes + ['test', '../pbd']
455 testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
456 'SAMPLERATE','XML','LRDF','COREAUDIO']
457 testobj.use = ['libpbd','libmidipp','libardour']
458 testobj.name = 'libardour-tests'
459 testobj.target = 'run-tests'
460 testobj.install_path = ''
462 'PACKAGE="libardour3test"',
463 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
464 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
465 'LOCALEDIR="' + os.path.join(
466 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
467 'VAMP_DIR="' + os.path.join(
468 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
470 if bld.env['FPU_OPTIMIZATION']:
471 testobj.source += [ 'sse_functions_xmm.cc' ]
472 if (bld.env['build_target'] == 'i386'
473 or bld.env['build_target'] == 'i686'):
474 testobj.source += [ 'sse_functions.s' ]
475 elif bld.env['build_target'] == 'x86_64':
476 testobj.source += [ 'sse_functions_64bit.s' ]
479 for p in ['runpc', 'lots_of_regions']:
480 profilingobj = bld(features = 'cxx cxxprogram')
481 profilingobj.source = '''
486 profilingobj.source.append('test/profiling/%s.cc' % p)
488 profilingobj.includes = obj.includes
489 profilingobj.includes.append ('test')
490 profilingobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
491 'SAMPLERATE','XML','LRDF','COREAUDIO']
492 profilingobj.use = ['libpbd','libmidipp','libardour']
493 profilingobj.name = 'libardour-profiling'
494 profilingobj.target = p
495 profilingobj.install_path = ''
496 profilingobj.defines = [
497 'PACKAGE="libardour3profile"',
498 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
499 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
500 'LOCALEDIR="' + os.path.join(
501 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
502 'VAMP_DIR="' + os.path.join(
503 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
505 if bld.env['FPU_OPTIMIZATION']:
506 profilingobj.source += [ 'sse_functions_xmm.cc' ]
507 if (bld.env['build_target'] == 'i386'
508 or bld.env['build_target'] == 'i686'):
509 profilingobj.source += [ 'sse_functions.s' ]
510 elif bld.env['build_target'] == 'x86_64':
511 profilingobj.source += [ 'sse_functions_64bit.s' ]
517 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
521 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
525 autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
529 autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,