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',
75 'element_import_handler.cc',
76 'element_importer.cc',
80 'export_channel_configuration.cc',
83 'export_format_base.cc',
84 'export_format_manager.cc',
85 'export_format_specification.cc',
89 'export_processor.cc',
90 'export_profile_manager.cc',
93 'export_utilities.cc',
95 'filename_extensions.cc',
96 'filesystem_paths.cc',
103 'internal_return.cc',
111 'location_importer.cc',
114 'midi_clock_slave.cc',
115 'midi_diskstream.cc',
117 'midi_patch_manager.cc',
121 'midi_ring_buffer.cc',
123 'midi_state_tracker.cc',
130 'named_selection.cc',
135 'playlist_factory.cc',
144 'rc_configuration.cc',
145 'recent_sessions.cc',
148 'resampled_source.cc',
158 'session_command.cc',
159 'session_configuration.cc',
160 'session_directory.cc',
163 'session_metadata.cc',
165 'session_process.cc',
167 'session_state_utils.cc',
169 'session_transport.cc',
172 'sndfile_helpers.cc',
173 'sndfileimportable.cc',
179 'tape_file_matcher.cc',
182 'tempo_map_importer.cc',
185 'transient_detector.cc',
191 def flac_supported():
192 cmd = subprocess.Popen ("sndfile-info testfile.flac",
193 stdout = subprocess.PIPE,
194 stderr = subprocess.STDOUT, shell = True)
195 out = cmd.communicate()[0];
196 return re.search ('unknown format', out) == None
199 cmd = subprocess.Popen ("sndfile-info testfile.ogg",
200 stdout = subprocess.PIPE,
201 stderr = subprocess.STDOUT, shell = True)
202 out = cmd.communicate()[0];
203 return re.search ('unknown format', out) == None
205 def set_options(opt):
206 autowaf.set_options(opt)
209 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
210 'libardour3', MAJOR, MINOR, MICRO)
211 autowaf.configure(conf)
212 conf.check_tool('compiler_cxx gas')
213 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
214 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
215 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
216 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
217 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
218 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
219 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
220 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
221 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
222 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
223 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
224 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
226 # we don't try to detect this, since its part of our source tree
228 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
229 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
231 conf.define('CURRENT_SESSION_FILE_VERSION', CURRENT_SESSION_FILE_VERSION)
233 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
234 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
237 conf.define ('HAVE_FLAC', 1)
238 autowaf.display_msg(conf, 'Checking for FLAC support', True)
240 autowaf.display_msg(conf, 'Checking for FLAC support', False)
242 conf.define ('HAVE_OGG', 1)
243 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True)
245 autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False)
247 conf.write_config_header('libardour-config.h')
250 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
251 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
256 obj = bld.new_task_gen('cxx', 'shlib')
257 obj.source = libardour_sources
258 obj.export_incdirs = ['.']
259 obj.includes = ['.', '../surfaces/control_protocol', '..']
260 obj.name = 'libardour'
261 obj.target = 'ardour'
262 obj.uselib = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF OSX'
263 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
264 obj.vnum = LIBARDOUR_LIB_VERSION
265 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
266 obj.cxxflags = ['-DPACKAGE="libardour3"']
267 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
268 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
269 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
270 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
271 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
272 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
273 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
274 #obj.source += ' st_stretch.cc st_pitch.cc '
275 #obj.uselib += ' SOUNDTOUCH '
276 #obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
278 obj.env.append_value('LINKFLAGS', 'default/libs/surfaces/control_protocol/smpte_1.o')
280 # TODO: The above is an ugly hack that shouldn't be needed. We really need
281 # to refactor SMPTE out of libardour_cp to get rid of that circular dependency
284 if bld.env['HAVE_SLV2']:
285 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
286 obj.uselib += ' SLV2 '
289 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
291 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
292 obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
294 if bld.env['HAVE_AUDIOUNITS'] or bld.env['HAVE_COREAUDIO']:
295 obj.uselib_local += ' libappleutility'
297 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
298 obj.source += [ 'audio_unit.cc' ]
300 if bld.env['FPU_OPTIMIZATION']:
301 obj.source += [ 'sse_functions_xmm.cc' ]
302 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
303 obj.source += [ 'sse_functions.s' ]
304 elif bld.env['build_target'] == 'x86_64':
305 obj.source += [ 'sse_functions_64bit.s' ]
308 if bld.env['ENABLE_NLS']:
309 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
311 lang = os.path.basename (mo).replace ('.mo', '')
312 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
314 if bld.env['HAVE_CPPUNIT']:
316 testobj = bld.new_task_gen('cxx', 'program')
319 tests/interpolation-test.cc
322 testobj.includes = obj.includes + ['../pbd/']
323 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE'
324 testobj.name = 'libardour-tests'
325 testobj.target = 'run-tests'
326 testobj.install_path = ''
333 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)