8 from w18n import build_i18n
10 # Version of this package (even if built as a child)
14 LIBARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
16 # Library version (UNIX style major, minor, micro)
17 # major increment <=> incompatible changes
18 # minor increment <=> compatible changes (additions)
19 # micro increment <=> no interface changes
20 LIBARDOUR_LIB_VERSION = '3.0.0'
22 # default state file version for this build
23 CURRENT_SESSION_FILE_VERSION = 3000
25 # Variables for 'waf dist'
27 VERSION = LIBARDOUR_VERSION
33 path_prefix = 'libs/ardour/'
39 'audio_diskstream.cc',
42 'audio_playlist_importer.cc',
44 'audio_region_importer.cc',
46 'audio_track_importer.cc',
49 'audiofile_tagger.cc',
56 'automation_control.cc',
58 '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',
84 'export_format_base.cc',
85 'export_format_manager.cc',
86 'export_format_specification.cc',
90 'export_processor.cc',
91 'export_profile_manager.cc',
94 'export_utilities.cc',
96 'filename_extensions.cc',
97 'filesystem_paths.cc',
104 'internal_return.cc',
112 'location_importer.cc',
115 'midi_clock_slave.cc',
116 'midi_diskstream.cc',
118 'midi_patch_manager.cc',
122 'midi_ring_buffer.cc',
124 'midi_state_tracker.cc',
131 'named_selection.cc',
137 'playlist_factory.cc',
146 'rc_configuration.cc',
147 'recent_sessions.cc',
150 'resampled_source.cc',
160 'session_command.cc',
161 'session_configuration.cc',
162 'session_directory.cc',
165 'session_metadata.cc',
167 'session_playlists.cc',
168 'session_process.cc',
170 'session_state_utils.cc',
172 'session_transport.cc',
176 'sndfile_helpers.cc',
177 'sndfileimportable.cc',
183 'tape_file_matcher.cc',
186 'tempo_map_importer.cc',
189 'transient_detector.cc',
195 def flac_supported():
196 cmd = subprocess.Popen ("sndfile-info testfile.flac",
197 stdout = subprocess.PIPE,
198 stderr = subprocess.STDOUT, shell = True)
199 out = cmd.communicate()[0];
200 return re.search ('unknown format', out) == None
203 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
204 stdout = subprocess.PIPE,
205 stderr = subprocess.STDOUT, shell = True)
206 out = cmd.communicate()[0];
207 return re.search ('unknown format', out) == None
209 def set_options(opt):
210 autowaf.set_options(opt)
213 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
214 'libardour3', MAJOR, MINOR, MICRO)
215 autowaf.configure(conf)
216 conf.check_tool('compiler_cxx gas')
217 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
218 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
219 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
220 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
221 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
222 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
223 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
224 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
225 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
226 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
227 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
228 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
230 # we don't try to detect this, since its part of our source tree
232 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
233 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
235 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
237 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
238 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
241 conf.define ('HAVE_FLAC', 1)
242 autowaf.display_msg(conf, 'Checking for FLAC support', True)
244 autowaf.display_msg(conf, 'Checking for FLAC support', False)
246 conf.define ('HAVE_OGG', 1)
247 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
249 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
251 conf.write_config_header('libardour-config.h')
254 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
255 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
260 obj = bld.new_task_gen('cxx', 'shlib')
261 obj.source = libardour_sources
262 obj.export_incdirs = ['.']
263 obj.includes = ['.', '../surfaces/control_protocol', '..']
264 obj.name = 'libardour'
265 obj.target = 'ardour'
266 obj.uselib = 'GLIBMM GTHREAD AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX COREAUDIO'
267 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
268 obj.vnum = LIBARDOUR_LIB_VERSION
269 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
270 obj.cxxflags = ['-DPACKAGE="libardour3"']
271 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
272 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
273 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
274 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
275 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
276 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
277 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
278 #obj.source += ' st_stretch.cc st_pitch.cc '
279 #obj.uselib += ' SOUNDTOUCH '
280 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
282 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
284 # TODO: The above is an ugly hack that shouldn't be needed. We really need
285 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
288 if bld.env['HAVE_SLV2']:
289 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
290 obj.uselib += ' SLV2 '
293 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
295 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
296 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
298 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
299 obj.uselib_local += ' libappleutility'
301 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
302 obj.source += [ 'audio_unit.cc' ]
304 if bld.env['FPU_OPTIMIZATION']:
305 obj.source += [ 'sse_functions_xmm.cc' ]
306 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
307 obj.source += [ 'sse_functions.s' ]
308 elif bld.env['build_target'] == 'x86_64':
309 obj.source += [ 'sse_functions_64bit.s' ]
312 if bld.env['ENABLE_NLS']:
313 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
315 lang = os.path.basename (mo).replace ('.mo', '')
316 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
318 if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
320 testobj = bld.new_task_gen('cxx', 'program')
323 test/InterpolationTest.cpp
326 testobj.includes = obj.includes + ['../pbd/']
327 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM GTHREAD SAMPLERATE XML LRDF COREAUDIO'
328 testobj.uselib_local = 'libpbd libmidipp libardour'
329 testobj.name = 'libardour-tests'
330 testobj.target = 'run-tests'
331 testobj.install_path = ''
332 testobj.cxxflags = ['-DPACKAGE="libardour3test"']
333 testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
334 testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
335 testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
336 testobj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
337 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
338 testobj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
339 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
340 if bld.env['FPU_OPTIMIZATION']:
341 testobj.source += [ 'sse_functions_xmm.cc' ]
342 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
343 testobj.source += [ 'sse_functions.s' ]
344 elif bld.env['build_target'] == 'x86_64':
345 testobj.source += [ 'sse_functions_64bit.s' ]
351 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)