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'
25 VERSION = LIBARDOUR_VERSION
31 path_prefix = 'libs/ardour/'
37 'audio_diskstream.cc',
40 'audio_playlist_importer.cc',
41 'audio_playlist_source.cc',
43 'audio_region_importer.cc',
45 'audio_track_importer.cc',
48 'audiofile_tagger.cc',
55 'automation_control.cc',
57 'beats_frames_converter.cc',
65 'capturing_processor.cc',
70 'control_protocol_manager.cc',
71 'control_protocol_search_path.cc',
73 'crossfade_binder.cc',
81 'element_import_handler.cc',
82 'element_importer.cc',
86 'export_channel_configuration.cc',
89 'export_format_base.cc',
90 'export_format_manager.cc',
91 'export_format_specification.cc',
93 'export_formats_search_path.cc',
94 'export_graph_builder.cc',
97 'export_profile_manager.cc',
101 'filename_extensions.cc',
102 '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 autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
259 atleast_version='0.0.0', mandatory=False)
260 if conf.is_defined('HAVE_LILV'):
261 autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
262 atleast_version='0.2.0', mandatory=False)
263 # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
265 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
266 atleast_version='1.12.0', mandatory=False)
267 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
268 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
269 atleast_version='1.2.1')
270 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
271 atleast_version='7.0.0')
273 # we don't try to detect this, since its part of our source tree
275 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
276 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
278 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
280 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
282 conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
283 define_name='HAVE_JACK_SESSION')
285 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
287 conf.check_cc(fragment = '''
288 #include <jack/jack.h>
289 void callback(jack_status_t code, const char* reason, void* arg) { return; }
290 int main(int argc, char **argv) {
292 jack_on_info_shutdown(c, callback, (void*) 0);
296 msg = 'Checking for jack_on_info_shutdown',
297 define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
300 missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
302 conf.check_cc(fragment = '''
303 #include <jack/jack.h>
304 int main(int argc, char **argv) {
306 jack_latency_range_t r;
307 jack_port_set_latency_range(p, JackCaptureLatency, &r);
311 msg = 'Checking for new JACK latency API',
314 errmsg = missing_jack_message)
316 conf.check_cc(fragment = '''
317 #include <jack/jack.h>
318 int main(int argc, char **argv) {
319 jack_port_type_get_buffer_size((jack_client_t*)0, "");
323 msg = 'Checking for new jack_port_type_get_buffer_size',
326 errmsg = missing_jack_message)
329 conf.define ('HAVE_FLAC', 1)
331 conf.define ('HAVE_OGG', 1)
333 if conf.is_defined('HAVE_LILV'):
334 conf.define ('LV2_SUPPORT', 1)
336 conf.write_config_header('libardour-config.h', remove=False)
339 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
340 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
341 autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
342 autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
347 obj = bld(features = 'c cxx cshlib cxxshlib')
348 obj.source = libardour_sources
349 obj.export_includes = ['.']
350 obj.includes = ['.', '../surfaces/control_protocol', '..']
351 obj.name = 'libardour'
352 obj.target = 'ardour'
353 obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
354 'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
355 'OSX','BOOST','CURL','DL']
356 obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
357 'libvampplugin','libtaglib','librubberband',
359 obj.vnum = LIBARDOUR_LIB_VERSION
360 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
362 'PACKAGE="libardour3"',
363 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
364 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
365 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
366 'LOCALEDIR="' + os.path.join(
367 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
368 'VAMP_DIR="' + os.path.join(
369 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"',
370 'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
373 #obj.source += ' st_stretch.cc st_pitch.cc '
374 #obj.uselib += ' SOUNDTOUCH '
375 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
377 if bld.is_defined('HAVE_LILV') :
378 obj.source += [ 'lv2_plugin_lilv.cc', 'lv2_event_buffer.cc',
379 'uri_map.cc', 'rdff.c' ]
380 obj.uselib += ['LILV']
381 if bld.is_defined('HAVE_SUIL'):
382 obj.uselib += ['SUIL']
384 if bld.is_defined('VST_SUPPORT'):
385 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
386 obj.includes += [ '../fst' ]
387 obj.defines += [ 'VST_SUPPORT' ]
389 if bld.is_defined('LXVST_SUPPORT'):
390 obj.source += [ 'lxvst_plugin.cc', 'session_lxvst.cc', 'vstfx.cc', 'vstfxinfofile.cc' ]
391 obj.defines += [ 'LXVST_SUPPORT' ]
393 if bld.is_defined('HAVE_COREAUDIO'):
394 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
395 obj.use += ['libappleutility']
396 obj.source += [ 'audio_unit.cc' ]
398 if Options.options.fpu_optimization:
399 if (bld.env['build_target'] == 'i386'
400 or bld.env['build_target'] == 'i686'):
401 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
402 elif bld.env['build_target'] == 'x86_64':
403 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
406 if bld.is_defined('ENABLE_NLS'):
407 mo_files = bld.path.ant_glob('po/*.mo')
409 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
410 bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
411 lang, 'LC_MESSAGES', 'libardour3.mo'),
414 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
416 testobj = bld(features = 'cxx cxxprogram')
419 test/interpolation_test.cpp
420 test/midi_clock_slave_test.cpp
421 test/resampled_source.cc
425 testobj.includes = obj.includes + ['test', '../pbd']
426 testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
427 'SAMPLERATE','XML','LRDF','COREAUDIO']
428 testobj.use = ['libpbd','libmidipp','libardour']
429 testobj.name = 'libardour-tests'
430 testobj.target = 'run-tests'
431 testobj.install_path = ''
433 'PACKAGE="libardour3test"',
434 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
435 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
436 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
437 'LOCALEDIR="' + os.path.join(
438 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
439 'VAMP_DIR="' + os.path.join(
440 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
442 if bld.env['FPU_OPTIMIZATION']:
443 testobj.source += [ 'sse_functions_xmm.cc' ]
444 if (bld.env['build_target'] == 'i386'
445 or bld.env['build_target'] == 'i686'):
446 testobj.source += [ 'sse_functions.s' ]
447 elif bld.env['build_target'] == 'x86_64':
448 testobj.source += [ 'sse_functions_64bit.s' ]
454 autowaf.build_i18n(bld, top, 'libs/ardour', APPNAME, libardour_sources,