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 # Variables for 'waf dist'
24 VERSION = LIBARDOUR_VERSION
30 path_prefix = 'libs/ardour/'
36 'audio_diskstream.cc',
39 'audio_playlist_importer.cc',
41 'audio_region_importer.cc',
43 'audio_track_importer.cc',
46 'audiofile_tagger.cc',
53 'automation_control.cc',
55 'beats_frames_converter.cc',
63 'control_protocol_manager.cc',
64 'control_protocol_search_path.cc',
71 'element_import_handler.cc',
72 'element_importer.cc',
76 'export_channel_configuration.cc',
79 'export_format_base.cc',
80 'export_format_manager.cc',
81 'export_format_specification.cc',
85 'export_processor.cc',
86 'export_profile_manager.cc',
89 'export_utilities.cc',
91 'filename_extensions.cc',
92 'filesystem_paths.cc',
107 'location_importer.cc',
110 'midi_clock_slave.cc',
111 'midi_diskstream.cc',
113 'midi_patch_manager.cc',
117 'midi_ring_buffer.cc',
119 'midi_state_tracker.cc',
126 'named_selection.cc',
131 'playlist_factory.cc',
140 'rc_configuration.cc',
141 'recent_sessions.cc',
144 'resampled_source.cc',
154 'session_command.cc',
155 'session_configuration.cc',
156 'session_directory.cc',
159 'session_metadata.cc',
161 'session_process.cc',
163 'session_state_utils.cc',
165 'session_transport.cc',
168 'sndfile_helpers.cc',
169 'sndfileimportable.cc',
175 'tape_file_matcher.cc',
178 'tempo_map_importer.cc',
181 'transient_detector.cc',
187 def flac_supported():
188 cmd = subprocess.Popen ("sndfile-info testfile.flac",
189 stdout = subprocess.PIPE,
190 stderr = subprocess.STDOUT, shell = True)
191 out = cmd.communicate()[0];
192 return re.search ('unknown format', out) == None
195 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
196 stdout = subprocess.PIPE,
197 stderr = subprocess.STDOUT, shell = True)
198 out = cmd.communicate()[0];
199 return re.search ('unknown format', out) == None
201 def set_options(opt):
202 autowaf.set_options(opt)
205 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
206 'libardour3', MAJOR, MINOR, MICRO)
207 autowaf.configure(conf)
208 conf.check_tool('compiler_cxx gas')
209 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
210 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
211 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
212 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
213 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
214 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
215 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
216 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
217 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
218 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
219 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
220 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
222 # we don't try to detect this, since its part of our source tree
224 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
225 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
227 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
228 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
231 conf.define ('HAVE_FLAC', 1)
232 autowaf.display_msg(conf, 'Checking for FLAC support', True)
234 autowaf.display_msg(conf, 'Checking for FLAC support', False)
236 conf.define ('HAVE_OGG', 1)
237 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
239 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
241 conf.write_config_header('libardour-config.h')
244 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
245 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
250 obj = bld.new_task_gen('cxx', 'shlib')
251 obj.source = libardour_sources
252 obj.export_incdirs = ['.']
253 obj.includes = ['.', '../surfaces/control_protocol', '..']
254 obj.name = 'libardour'
255 obj.target = 'ardour'
256 obj.uselib = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX'
257 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
258 obj.vnum = LIBARDOUR_LIB_VERSION
259 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
260 obj.cxxflags = ['-DPACKAGE="libardour3"']
261 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
262 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
263 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
264 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
265 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
266 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
267 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
268 #obj.source += ' st_stretch.cc st_pitch.cc '
269 #obj.uselib += ' SOUNDTOUCH '
270 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
272 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
274 # TODO: The above is an ugly hack that shouldn't be needed. We really need
275 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
278 if bld.env['HAVE_SLV2']:
279 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
280 obj.uselib += ' SLV2 '
283 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
285 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
286 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
288 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
289 obj.uselib_local += ' libappleutility'
291 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
292 obj.source += [ 'audio_unit.cc' ]
294 if bld.env['FPU_OPTIMIZATION']:
295 obj.source += [ 'sse_functions_xmm.cc' ]
296 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
297 obj.source += [ 'sse_functions.s' ]
298 elif bld.env['build_target'] == 'x86_64':
299 obj.source += [ 'sse_functions_64bit.s' ]
302 if bld.env['ENABLE_NLS']:
303 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
305 lang = os.path.basename (mo).replace ('.mo', '')
306 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
308 if bld.env['HAVE_CPPUNIT']:
310 testobj = bld.new_task_gen('cxx', 'program')
313 tests/interpolation-test.cc
316 testobj.includes = obj.includes + ['../pbd/']
317 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE'
318 testobj.name = 'libardour-tests'
319 testobj.target = 'run-tests'
320 testobj.install_path = ''
327 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)