9 # Version of this package (even if built as a child)
13 LIBARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
15 # Library version (UNIX style major, minor, micro)
16 # major increment <=> incompatible changes
17 # minor increment <=> compatible changes (additions)
18 # micro increment <=> no interface changes
19 LIBARDOUR_LIB_VERSION = '3.0.0'
21 # default state file version for this build
22 CURRENT_SESSION_FILE_VERSION = 3000
24 # Variables for 'waf dist'
26 VERSION = LIBARDOUR_VERSION
32 path_prefix = 'libs/ardour/'
38 'audio_diskstream.cc',
41 'audio_playlist_importer.cc',
43 'audio_region_importer.cc',
45 'audio_track_importer.cc',
48 'audiofile_tagger.cc',
55 'automation_control.cc',
57 'beats_frames_converter.cc',
67 'control_protocol_manager.cc',
68 'control_protocol_search_path.cc',
76 'element_import_handler.cc',
77 'element_importer.cc',
81 'export_channel_configuration.cc',
83 'export_format_base.cc',
84 'export_format_manager.cc',
85 'export_format_specification.cc',
87 'export_graph_builder.cc',
90 'export_profile_manager.cc',
94 'filename_extensions.cc',
95 'filesystem_paths.cc',
101 'internal_return.cc',
109 'location_importer.cc',
112 'midi_clock_slave.cc',
113 'midi_diskstream.cc',
115 'midi_patch_manager.cc',
119 'midi_ring_buffer.cc',
121 'midi_state_tracker.cc',
129 'named_selection.cc',
135 'playlist_factory.cc',
144 'rc_configuration.cc',
145 'recent_sessions.cc',
149 'resampled_source.cc',
154 'route_group_member.cc',
160 'session_command.cc',
161 'session_configuration.cc',
162 'session_directory.cc',
166 'session_metadata.cc',
168 'session_playlists.cc',
169 'session_process.cc',
170 'session_rtevents.cc',
172 'session_state_utils.cc',
174 'session_transport.cc',
178 'sndfile_helpers.cc',
179 'sndfileimportable.cc',
185 'tape_file_matcher.cc',
188 'tempo_map_importer.cc',
191 'transient_detector.cc',
197 def flac_supported():
198 cmd = subprocess.Popen ("sndfile-info testfile.flac",
199 stdout = subprocess.PIPE,
200 stderr = subprocess.STDOUT, shell = True)
201 out = cmd.communicate()[0];
202 return re.search ('unknown format', out) == None
205 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
206 stdout = subprocess.PIPE,
207 stderr = subprocess.STDOUT, shell = True)
208 out = cmd.communicate()[0];
209 return re.search ('unknown format', out) == None
211 def set_options(opt):
212 autowaf.set_options(opt)
215 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
216 'libardour3', MAJOR, MINOR, MICRO)
217 autowaf.configure(conf)
218 conf.check_tool('compiler_cxx gas')
219 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
220 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
221 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
222 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
223 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
224 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
225 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
226 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
227 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
228 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
229 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
230 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
232 # we don't try to detect this, since its part of our source tree
234 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
235 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
237 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
239 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
240 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
243 conf.define ('HAVE_FLAC', 1)
244 autowaf.display_msg(conf, 'Checking for FLAC support', True)
246 autowaf.display_msg(conf, 'Checking for FLAC support', False)
248 conf.define ('HAVE_OGG', 1)
249 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
251 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
253 conf.write_config_header('libardour-config.h')
256 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
257 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
262 obj = bld.new_task_gen('cxx', 'shlib')
263 obj.source = libardour_sources
264 obj.export_incdirs = ['.']
265 obj.includes = ['.', '../surfaces/control_protocol', '..']
266 obj.name = 'libardour'
267 obj.target = 'ardour'
268 obj.uselib = 'GLIBMM GTHREAD AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX COREAUDIO'
269 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband libaudiographer'
270 obj.vnum = LIBARDOUR_LIB_VERSION
271 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
272 obj.cxxflags = ['-DPACKAGE="libardour3"']
273 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
274 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
275 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
276 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
277 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
278 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
279 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
280 #obj.source += ' st_stretch.cc st_pitch.cc '
281 #obj.uselib += ' SOUNDTOUCH '
282 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
284 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
286 # TODO: The above is an ugly hack that shouldn't be needed. We really need
287 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
290 if bld.env['HAVE_SLV2']:
291 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
292 obj.uselib += ' SLV2 '
295 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
297 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
298 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
300 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
301 obj.uselib_local += ' libappleutility'
303 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
304 obj.source += [ 'audio_unit.cc' ]
306 if bld.env['FPU_OPTIMIZATION']:
307 obj.source += [ 'sse_functions_xmm.cc' ]
308 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
309 obj.source += [ 'sse_functions.s' ]
310 elif bld.env['build_target'] == 'x86_64':
311 obj.source += [ 'sse_functions_64bit.s' ]
314 if bld.env['ENABLE_NLS']:
315 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
317 lang = os.path.basename (mo).replace ('.mo', '')
318 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
320 if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
322 testobj = bld.new_task_gen('cxx', 'program')
325 test/interpolation_test.cpp
326 test/midi_clock_slave_test.cpp
329 testobj.includes = obj.includes + ['../pbd/']
330 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM GTHREAD SAMPLERATE XML LRDF COREAUDIO'
331 testobj.uselib_local = 'libpbd libmidipp libardour'
332 testobj.name = 'libardour-tests'
333 testobj.target = 'run-tests'
334 testobj.install_path = ''
335 testobj.cxxflags = ['-DPACKAGE="libardour3test"']
336 testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
337 testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
338 testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
339 testobj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
340 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
341 testobj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
342 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
343 if bld.env['FPU_OPTIMIZATION']:
344 testobj.source += [ 'sse_functions_xmm.cc' ]
345 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
346 testobj.source += [ 'sse_functions.s' ]
347 elif bld.env['build_target'] == 'x86_64':
348 testobj.source += [ 'sse_functions_64bit.s' ]
354 autowaf.build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)