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 = 3000
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',
74 'crossfade_binder.cc',
82 'element_import_handler.cc',
83 'element_importer.cc',
87 'export_channel_configuration.cc',
90 'export_format_base.cc',
91 'export_format_manager.cc',
92 'export_format_specification.cc',
94 'export_formats_search_path.cc',
95 'export_graph_builder.cc',
98 'export_profile_manager.cc',
100 'export_timespan.cc',
102 'filename_extensions.cc',
103 'filesystem_paths.cc',
110 'internal_return.cc',
118 'location_importer.cc',
120 'midi_automation_list_binder.cc',
122 'midi_clock_slave.cc',
123 'midi_diskstream.cc',
125 'midi_patch_manager.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',
222 def flac_supported():
223 cmd = subprocess.Popen ("sndfile-info testfile.flac",
224 stdout = subprocess.PIPE,
225 stderr = subprocess.STDOUT, shell = True)
226 out = cmd.communicate()[0].decode('utf-8');
227 return re.search ('unknown format', out) == None
230 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
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
237 autowaf.set_options(opt)
240 conf.load('compiler_cxx')
242 autowaf.build_version_files(
243 path_prefix + 'ardour/version.h',
244 path_prefix + 'version.cc',
245 'libardour3', MAJOR, MINOR, MICRO)
246 autowaf.configure(conf)
247 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO',
248 atleast_version='0.3.2')
249 autowaf.check_pkg(conf, 'jack', uselib_store='JACK',
250 atleast_version='0.118.2')
251 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
252 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF',
253 atleast_version='0.4.0')
254 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE',
255 atleast_version='0.1.0')
256 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP',
257 atleast_version='2.0')
258 if Options.options.lv2:
259 autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
260 atleast_version='0.0.0', mandatory=False)
261 autowaf.check_pkg(conf, 'lilv-0', uselib_store='NEW_LILV',
262 atleast_version='0.9.0', mandatory=False)
263 if conf.is_defined('HAVE_LILV'):
264 autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
265 atleast_version='0.2.0', mandatory=False)
267 # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
269 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
270 atleast_version='1.12.0', mandatory=False)
271 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
272 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
273 atleast_version='1.2.1')
274 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
275 atleast_version='7.0.0')
277 # we don't try to detect this, since its part of our source tree
279 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
280 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
282 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
284 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
286 conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
287 define_name='HAVE_JACK_SESSION')
289 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
291 conf.check_cc(fragment = '''
292 #include <jack/jack.h>
293 void callback(jack_status_t code, const char* reason, void* arg) { return; }
294 int main(int argc, char **argv) {
296 jack_on_info_shutdown(c, callback, (void*) 0);
300 msg = 'Checking for jack_on_info_shutdown',
301 define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
304 missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
306 conf.check_cc(fragment = '''
307 #include <jack/jack.h>
308 int main(int argc, char **argv) {
310 jack_latency_range_t r;
311 jack_port_set_latency_range(p, JackCaptureLatency, &r);
315 msg = 'Checking for new JACK latency API',
318 errmsg = missing_jack_message)
320 conf.check_cc(fragment = '''
321 #include <jack/jack.h>
322 int main(int argc, char **argv) {
323 jack_port_type_get_buffer_size((jack_client_t*)0, "");
327 msg = 'Checking for new jack_port_type_get_buffer_size',
330 errmsg = missing_jack_message)
333 conf.define ('HAVE_FLAC', 1)
335 conf.define ('HAVE_OGG', 1)
337 if Options.options.lv2 and conf.is_defined('HAVE_LILV'):
338 conf.define ('LV2_SUPPORT', 1)
340 conf.write_config_header('libardour-config.h', remove=False)
343 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
344 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
345 autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
346 autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
351 obj = bld(features = 'c cxx cshlib cxxshlib')
352 obj.source = libardour_sources
353 obj.export_includes = ['.']
354 obj.includes = ['.', '../surfaces/control_protocol', '..']
355 obj.name = 'libardour'
356 obj.target = 'ardour'
357 obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
358 'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
359 'OSX','BOOST','CURL','DL']
360 obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
361 'libvampplugin','libtaglib','librubberband',
363 obj.vnum = LIBARDOUR_LIB_VERSION
364 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
366 'PACKAGE="' + I18N_PACKAGE + '"',
367 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
368 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
369 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
370 'LOCALEDIR="' + os.path.join(
371 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
372 'VAMP_DIR="' + os.path.join(
373 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"',
374 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
377 #obj.source += ' st_stretch.cc st_pitch.cc '
378 #obj.uselib += ' SOUNDTOUCH '
379 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
381 if bld.is_defined('HAVE_LILV') :
382 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc',
383 'uri_map.cc', 'rdff.c' ]
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'
409 or bld.env['build_target'] == 'i686'):
410 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
411 elif bld.env['build_target'] == 'x86_64':
412 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
415 if bld.is_defined('ENABLE_NLS'):
416 mo_files = bld.path.ant_glob('po/*.mo')
418 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
419 bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
420 lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
423 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
425 testobj = bld(features = 'cxx cxxprogram')
428 test/test_needing_session.cc
429 test/test_needing_playlist_and_regions.cc
432 test/interpolation_test.cc
433 test/midi_clock_slave_test.cc
434 test/resampled_source_test.cc
435 test/framewalk_to_beats_test.cc
436 test/framepos_plus_beats_test.cc
437 test/framepos_minus_beats_test.cc
438 test/playlist_layering_test.cc
442 # Tests that don't work
443 # test/mantis_3356_test.cc
445 testobj.includes = obj.includes + ['test', '../pbd']
446 testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
447 'SAMPLERATE','XML','LRDF','COREAUDIO']
448 testobj.use = ['libpbd','libmidipp','libardour']
449 testobj.name = 'libardour-tests'
450 testobj.target = 'run-tests'
451 testobj.install_path = ''
453 'PACKAGE="libardour3test"',
454 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
455 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
456 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
457 'LOCALEDIR="' + os.path.join(
458 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
459 'VAMP_DIR="' + os.path.join(
460 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
462 if bld.env['FPU_OPTIMIZATION']:
463 testobj.source += [ 'sse_functions_xmm.cc' ]
464 if (bld.env['build_target'] == 'i386'
465 or bld.env['build_target'] == 'i686'):
466 testobj.source += [ 'sse_functions.s' ]
467 elif bld.env['build_target'] == 'x86_64':
468 testobj.source += [ 'sse_functions_64bit.s' ]
471 profilingobj = bld(features = 'cxx cxxprogram')
472 profilingobj.source = '''
474 test/profiling/runpc.cc
477 profilingobj.includes = obj.includes
478 profilingobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
479 'SAMPLERATE','XML','LRDF','COREAUDIO']
480 profilingobj.use = ['libpbd','libmidipp','libardour']
481 profilingobj.name = 'libardour-profiling'
482 profilingobj.target = 'run-profiling'
483 profilingobj.install_path = ''
484 profilingobj.defines = [
485 'PACKAGE="libardour3profile"',
486 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
487 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
488 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
489 'LOCALEDIR="' + os.path.join(
490 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
491 'VAMP_DIR="' + os.path.join(
492 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
494 if bld.env['FPU_OPTIMIZATION']:
495 profilingobj.source += [ 'sse_functions_xmm.cc' ]
496 if (bld.env['build_target'] == 'i386'
497 or bld.env['build_target'] == 'i686'):
498 profilingobj.source += [ 'sse_functions.s' ]
499 elif bld.env['build_target'] == 'x86_64':
500 profilingobj.source += [ 'sse_functions_64bit.s' ]
506 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
510 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
514 autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
518 autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,