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 if Options.options.lv2:
259 autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
260 atleast_version='0.0.0', mandatory=False)
261 if conf.is_defined('HAVE_LILV'):
262 autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
263 atleast_version='0.2.0', mandatory=False)
264 # autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
266 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT',
267 atleast_version='1.12.0', mandatory=False)
268 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
269 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
270 atleast_version='1.2.1')
271 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
272 atleast_version='7.0.0')
274 # we don't try to detect this, since its part of our source tree
276 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
277 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
279 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
281 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
283 conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
284 define_name='HAVE_JACK_SESSION')
286 conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
288 conf.check_cc(fragment = '''
289 #include <jack/jack.h>
290 void callback(jack_status_t code, const char* reason, void* arg) { return; }
291 int main(int argc, char **argv) {
293 jack_on_info_shutdown(c, callback, (void*) 0);
297 msg = 'Checking for jack_on_info_shutdown',
298 define_name = 'HAVE_JACK_ON_INFO_SHUTDOWN',
301 missing_jack_message = 'missing - a version of JACK that supports jack_port_set_latency_range() is required to compile Ardour3.'
303 conf.check_cc(fragment = '''
304 #include <jack/jack.h>
305 int main(int argc, char **argv) {
307 jack_latency_range_t r;
308 jack_port_set_latency_range(p, JackCaptureLatency, &r);
312 msg = 'Checking for new JACK latency API',
315 errmsg = missing_jack_message)
317 conf.check_cc(fragment = '''
318 #include <jack/jack.h>
319 int main(int argc, char **argv) {
320 jack_port_type_get_buffer_size((jack_client_t*)0, "");
324 msg = 'Checking for new jack_port_type_get_buffer_size',
327 errmsg = missing_jack_message)
330 conf.define ('HAVE_FLAC', 1)
332 conf.define ('HAVE_OGG', 1)
334 if Options.options.lv2 and conf.is_defined('HAVE_LILV'):
335 print "LV2 option was ", Options.options.lv2
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="libardour3"',
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_lilv.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('VST_SUPPORT'):
387 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
388 obj.includes += [ '../fst' ]
389 obj.defines += [ 'VST_SUPPORT' ]
391 if bld.is_defined('LXVST_SUPPORT'):
392 obj.source += [ 'lxvst_plugin.cc', 'session_lxvst.cc', 'vstfx.cc', 'vstfxinfofile.cc' ]
393 obj.defines += [ 'LXVST_SUPPORT' ]
395 if bld.is_defined('HAVE_COREAUDIO'):
396 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
397 obj.use += ['libappleutility']
398 obj.source += [ 'audio_unit.cc' ]
400 if Options.options.fpu_optimization:
401 if (bld.env['build_target'] == 'i386'
402 or bld.env['build_target'] == 'i686'):
403 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions.s' ]
404 elif bld.env['build_target'] == 'x86_64':
405 obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_64bit.s' ]
408 if bld.is_defined('ENABLE_NLS'):
409 mo_files = bld.path.ant_glob('po/*.mo')
411 lang = os.path.basename(mo.srcpath()).replace('.mo', '')
412 bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
413 lang, 'LC_MESSAGES', 'libardour3.mo'),
416 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
418 testobj = bld(features = 'cxx cxxprogram')
422 test/interpolation_test.cpp
423 test/midi_clock_slave_test.cpp
424 test/resampled_source.cc
428 testobj.includes = obj.includes + ['test', '../pbd']
429 testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
430 'SAMPLERATE','XML','LRDF','COREAUDIO']
431 testobj.use = ['libpbd','libmidipp','libardour']
432 testobj.name = 'libardour-tests'
433 testobj.target = 'run-tests'
434 testobj.install_path = ''
436 'PACKAGE="libardour3test"',
437 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
438 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
439 'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
440 'LOCALEDIR="' + os.path.join(
441 os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
442 'VAMP_DIR="' + os.path.join(
443 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
445 if bld.env['FPU_OPTIMIZATION']:
446 testobj.source += [ 'sse_functions_xmm.cc' ]
447 if (bld.env['build_target'] == 'i386'
448 or bld.env['build_target'] == 'i686'):
449 testobj.source += [ 'sse_functions.s' ]
450 elif bld.env['build_target'] == 'x86_64':
451 testobj.source += [ 'sse_functions_64bit.s' ]
457 autowaf.build_i18n(bld, top, 'libs/ardour', APPNAME, libardour_sources,