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',
111 'internal_return.cc',
119 'location_importer.cc',
121 'midi_automation_list_binder.cc',
123 'midi_clock_slave.cc',
124 'midi_diskstream.cc',
126 'midi_patch_manager.cc',
128 'midi_playlist_source.cc',
131 'midi_ring_buffer.cc',
133 'midi_state_tracker.cc',
138 'monitor_processor.cc',
142 'named_selection.cc',
145 'pan_controllable.cc',
149 'panner_search_path.cc',
154 'playlist_factory.cc',
155 'playlist_source.cc',
166 'rc_configuration.cc',
167 'recent_sessions.cc',
169 'resampled_source.cc',
176 'route_group_member.cc',
182 'session_command.cc',
183 'session_configuration.cc',
184 'session_directory.cc',
188 'session_metadata.cc',
191 'session_playlists.cc',
192 'session_process.cc',
193 'session_rtevents.cc',
195 'session_state_utils.cc',
197 'session_transport.cc',
201 'sndfile_helpers.cc',
202 'sndfileimportable.cc',
209 'tape_file_matcher.cc',
212 'tempo_map_importer.cc',
216 'transient_detector.cc',
217 '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, 'lilv-0', uselib_store='LILV',
261 atleast_version='0.0.0', mandatory=False)
262 if conf.is_defined('HAVE_LILV'):
263 autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
264 atleast_version='0.2.0', mandatory=False)
265 # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
267 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
268 atleast_version='1.12.0', mandatory=False)
269 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
270 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
271 atleast_version='1.2.1')
272 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
273 atleast_version='7.0.0')
275 # we don't try to detect this, since its part of our source tree
277 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
278 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
280 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
282 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
284 conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
285 define_name='HAVE_JACK_SESSION')
287 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
289 conf.check_cc(fragment = '''
290 #include <jack/jack.h>
291 void callback(jack_status_t code, const char* reason, void* arg) { return; }
292 int main(int argc, char **argv) {
294 jack_on_info_shutdown(c, callback, (void*) 0);
298 msg = 'Checking for jack_on_info_shutdown',
299 define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
302 missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
304 conf.check_cc(fragment = '''
305 #include <jack/jack.h>
306 int main(int argc, char **argv) {
308 jack_latency_range_t r;
309 jack_port_set_latency_range(p, JackCaptureLatency, &r);
313 msg = 'Checking for new JACK latency API',
316 errmsg = missing_jack_message)
318 conf.check_cc(fragment = '''
319 #include <jack/jack.h>
320 int main(int argc, char **argv) {
321 jack_port_type_get_buffer_size((jack_client_t*)0, "");
325 msg = 'Checking for new jack_port_type_get_buffer_size',
328 errmsg = missing_jack_message)
331 conf.define ('HAVE_FLAC', 1)
333 conf.define ('HAVE_OGG', 1)
335 if Options.options.lv2 and conf.is_defined('HAVE_LILV'):
336 conf.define ('LV2_SUPPORT', 1)
338 conf.write_config_header('libardour-config.h', remove=False)
341 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
342 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
343 autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
344 autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
349 obj = bld(features = 'c cxx cshlib cxxshlib')
350 obj.source = libardour_sources
351 obj.export_includes = ['.']
352 obj.includes = ['.', '../surfaces/control_protocol', '..']
353 obj.name = 'libardour'
354 obj.target = 'ardour'
355 obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
356 'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
357 'OSX','BOOST','CURL','DL']
358 obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
359 'libvampplugin','libtaglib','librubberband',
361 obj.vnum = LIBARDOUR_LIB_VERSION
362 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
364 'PACKAGE="' + I18N_PACKAGE + '"',
365 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
366 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
367 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
368 'LOCALEDIR="' + os.path.join(
369 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
370 'VAMP_DIR="' + os.path.join(
371 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"',
372 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
375 #obj.source += ' st_stretch.cc st_pitch.cc '
376 #obj.uselib += ' SOUNDTOUCH '
377 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
379 if bld.is_defined('HAVE_LILV') :
380 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc',
381 'uri_map.cc', 'rdff.c' ]
382 obj.uselib += ['LILV']
383 if bld.is_defined('HAVE_SUIL'):
384 obj.uselib += ['SUIL']
386 if bld.is_defined('WINDOWS_VST_SUPPORT'):
387 obj.source += [ 'windows_vst_plugin.cc']
388 obj.includes += [ '../fst' ]
389 obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
391 if bld.is_defined('LXVST_SUPPORT'):
392 obj.source += [ 'lxvst_plugin.cc', 'linux_vst_support.cc', 'linux_vst_info_file.cc' ]
393 obj.defines += [ 'LXVST_SUPPORT' ]
395 if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
396 obj.source += [ 'session_vst.cc', 'vst_plugin.cc' ]
398 if bld.is_defined('HAVE_COREAUDIO'):
399 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
400 obj.use += ['libappleutility']
402 if bld.is_defined('AUDIOUNIT_SUPPORT'):
403 obj.source += [ 'audio_unit.cc' ]
405 if Options.options.fpu_optimization:
406 if (bld.env['build_target'] == 'i386'
407 or bld.env['build_target'] == 'i686'):
408 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
409 elif bld.env['build_target'] == 'x86_64':
410 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
413 if bld.is_defined('ENABLE_NLS'):
414 mo_files = bld.path.ant_glob('po/*.mo')
416 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
417 bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
418 lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
421 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
423 testobj = bld(features = 'cxx cxxprogram')
427 test/interpolation_test.cc
428 test/midi_clock_slave_test.cc
429 test/resampled_source_test.cc
430 test/framewalk_to_beats_test.cc
431 test/framepos_plus_beats_test.cc
432 test/framepos_minus_beats_test.cc
433 test/playlist_layering_test.cc
437 # Tests that don't work
438 # test/mantis_3356_test.cc
440 testobj.includes = obj.includes + ['test', '../pbd']
441 testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
442 'SAMPLERATE','XML','LRDF','COREAUDIO']
443 testobj.use = ['libpbd','libmidipp','libardour']
444 testobj.name = 'libardour-tests'
445 testobj.target = 'run-tests'
446 testobj.install_path = ''
448 'PACKAGE="libardour3test"',
449 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
450 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
451 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
452 'LOCALEDIR="' + os.path.join(
453 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
454 'VAMP_DIR="' + os.path.join(
455 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
457 if bld.env['FPU_OPTIMIZATION']:
458 testobj.source += [ 'sse_functions_xmm.cc' ]
459 if (bld.env['build_target'] == 'i386'
460 or bld.env['build_target'] == 'i686'):
461 testobj.source += [ 'sse_functions.s' ]
462 elif bld.env['build_target'] == 'x86_64':
463 testobj.source += [ 'sse_functions_64bit.s' ]
469 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
473 autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
477 autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,
481 autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources,