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',
66 'control_protocol_manager.cc',
67 'control_protocol_search_path.cc',
74 'element_import_handler.cc',
75 'element_importer.cc',
79 'export_channel_configuration.cc',
82 'export_format_base.cc',
83 'export_format_manager.cc',
84 'export_format_specification.cc',
88 'export_processor.cc',
89 'export_profile_manager.cc',
92 'export_utilities.cc',
94 'filename_extensions.cc',
95 'filesystem_paths.cc',
102 'internal_return.cc',
110 'location_importer.cc',
113 'midi_clock_slave.cc',
114 'midi_diskstream.cc',
116 'midi_patch_manager.cc',
120 'midi_ring_buffer.cc',
122 'midi_state_tracker.cc',
129 'named_selection.cc',
134 'playlist_factory.cc',
143 'rc_configuration.cc',
144 'recent_sessions.cc',
147 'resampled_source.cc',
157 'session_command.cc',
158 'session_configuration.cc',
159 'session_directory.cc',
162 'session_metadata.cc',
164 'session_process.cc',
166 'session_state_utils.cc',
168 'session_transport.cc',
171 'sndfile_helpers.cc',
172 'sndfileimportable.cc',
178 'tape_file_matcher.cc',
181 'tempo_map_importer.cc',
184 'transient_detector.cc',
190 def flac_supported():
191 cmd = subprocess.Popen ("sndfile-info testfile.flac",
192 stdout = subprocess.PIPE,
193 stderr = subprocess.STDOUT, shell = True)
194 out = cmd.communicate()[0];
195 return re.search ('unknown format', out) == None
198 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
199 stdout = subprocess.PIPE,
200 stderr = subprocess.STDOUT, shell = True)
201 out = cmd.communicate()[0];
202 return re.search ('unknown format', out) == None
204 def set_options(opt):
205 autowaf.set_options(opt)
208 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
209 'libardour3', MAJOR, MINOR, MICRO)
210 autowaf.configure(conf)
211 conf.check_tool('compiler_cxx gas')
212 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
213 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
214 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
215 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
216 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
217 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
218 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
219 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
220 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
221 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
222 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
223 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
225 # we don't try to detect this, since its part of our source tree
227 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
228 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
230 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
232 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
233 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
236 conf.define ('HAVE_FLAC', 1)
237 autowaf.display_msg(conf, 'Checking for FLAC support', True)
239 autowaf.display_msg(conf, 'Checking for FLAC support', False)
241 conf.define ('HAVE_OGG', 1)
242 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
244 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
246 conf.write_config_header('libardour-config.h')
249 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
250 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
255 obj = bld.new_task_gen('cxx', 'shlib')
256 obj.source = libardour_sources
257 obj.export_incdirs = ['.']
258 obj.includes = ['.', '../surfaces/control_protocol', '..']
259 obj.name = 'libardour'
260 obj.target = 'ardour'
261 obj.uselib = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX'
262 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
263 obj.vnum = LIBARDOUR_LIB_VERSION
264 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
265 obj.cxxflags = ['-DPACKAGE="libardour3"']
266 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
267 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
268 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
269 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
270 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
271 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
272 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
273 #obj.source += ' st_stretch.cc st_pitch.cc '
274 #obj.uselib += ' SOUNDTOUCH '
275 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
277 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
279 # TODO: The above is an ugly hack that shouldn't be needed. We really need
280 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
283 if bld.env['HAVE_SLV2']:
284 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
285 obj.uselib += ' SLV2 '
288 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
290 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
291 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
293 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
294 obj.uselib_local += ' libappleutility'
296 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
297 obj.source += [ 'audio_unit.cc' ]
299 if bld.env['FPU_OPTIMIZATION']:
300 obj.source += [ 'sse_functions_xmm.cc' ]
301 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
302 obj.source += [ 'sse_functions.s' ]
303 elif bld.env['build_target'] == 'x86_64':
304 obj.source += [ 'sse_functions_64bit.s' ]
307 if bld.env['ENABLE_NLS']:
308 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
310 lang = os.path.basename (mo).replace ('.mo', '')
311 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
313 if bld.env['HAVE_CPPUNIT']:
315 testobj = bld.new_task_gen('cxx', 'program')
318 tests/interpolation-test.cc
321 testobj.includes = obj.includes + ['../pbd/']
322 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE'
323 testobj.name = 'libardour-tests'
324 testobj.target = 'run-tests'
325 testobj.install_path = ''
332 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)