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_process.cc',
169 'session_state_utils.cc',
171 'session_transport.cc',
175 'sndfile_helpers.cc',
176 'sndfileimportable.cc',
182 'tape_file_matcher.cc',
185 'tempo_map_importer.cc',
188 'transient_detector.cc',
194 def flac_supported():
195 cmd = subprocess.Popen ("sndfile-info testfile.flac",
196 stdout = subprocess.PIPE,
197 stderr = subprocess.STDOUT, shell = True)
198 out = cmd.communicate()[0];
199 return re.search ('unknown format', out) == None
202 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
203 stdout = subprocess.PIPE,
204 stderr = subprocess.STDOUT, shell = True)
205 out = cmd.communicate()[0];
206 return re.search ('unknown format', out) == None
208 def set_options(opt):
209 autowaf.set_options(opt)
212 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
213 'libardour3', MAJOR, MINOR, MICRO)
214 autowaf.configure(conf)
215 conf.check_tool('compiler_cxx gas')
216 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
217 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
218 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
219 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
220 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
221 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
222 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
223 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
224 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
225 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
226 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
227 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
229 # we don't try to detect this, since its part of our source tree
231 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
232 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
234 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
236 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
237 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
240 conf.define ('HAVE_FLAC', 1)
241 autowaf.display_msg(conf, 'Checking for FLAC support', True)
243 autowaf.display_msg(conf, 'Checking for FLAC support', False)
245 conf.define ('HAVE_OGG', 1)
246 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
248 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
250 conf.write_config_header('libardour-config.h')
253 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
254 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
259 obj = bld.new_task_gen('cxx', 'shlib')
260 obj.source = libardour_sources
261 obj.export_incdirs = ['.']
262 obj.includes = ['.', '../surfaces/control_protocol', '..']
263 obj.name = 'libardour'
264 obj.target = 'ardour'
265 obj.uselib = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX'
266 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
267 obj.vnum = LIBARDOUR_LIB_VERSION
268 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
269 obj.cxxflags = ['-DPACKAGE="libardour3"']
270 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
271 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
272 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
273 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
274 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
275 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
276 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
277 #obj.source += ' st_stretch.cc st_pitch.cc '
278 #obj.uselib += ' SOUNDTOUCH '
279 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
281 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
283 # TODO: The above is an ugly hack that shouldn't be needed. We really need
284 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
287 if bld.env['HAVE_SLV2']:
288 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
289 obj.uselib += ' SLV2 '
292 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
294 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
295 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
297 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
298 obj.uselib_local += ' libappleutility'
300 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
301 obj.source += [ 'audio_unit.cc' ]
303 if bld.env['FPU_OPTIMIZATION']:
304 obj.source += [ 'sse_functions_xmm.cc' ]
305 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
306 obj.source += [ 'sse_functions.s' ]
307 elif bld.env['build_target'] == 'x86_64':
308 obj.source += [ 'sse_functions_64bit.s' ]
311 if bld.env['ENABLE_NLS']:
312 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
314 lang = os.path.basename (mo).replace ('.mo', '')
315 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
317 if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
319 testobj = bld.new_task_gen('cxx', 'program')
322 test/InterpolationTest.cpp
325 testobj.includes = obj.includes + ['../pbd/']
326 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE XML LRDF'
327 testobj.uselib_local = 'libpbd libmidipp libardour'
328 testobj.name = 'libardour-tests'
329 testobj.target = 'run-tests'
330 testobj.install_path = ''
331 testobj.cxxflags = ['-DPACKAGE="libardour3test"']
332 testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
333 testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
334 testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
335 testobj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
336 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
337 testobj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
338 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
339 if bld.env['FPU_OPTIMIZATION']:
340 testobj.source += [ 'sse_functions_xmm.cc' ]
341 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
342 testobj.source += [ 'sse_functions.s' ]
343 elif bld.env['build_target'] == 'x86_64':
344 testobj.source += [ 'sse_functions_64bit.s' ]
350 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)