6 from w18n import build_i18n
8 # Version of this package (even if built as a child)
12 LIBARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
14 # Library version (UNIX style major, minor, micro)
15 # major increment <=> incompatible changes
16 # minor increment <=> compatible changes (additions)
17 # micro increment <=> no interface changes
18 LIBARDOUR_LIB_VERSION = '3.0.0'
20 # Variables for 'waf dist'
22 VERSION = LIBARDOUR_VERSION
28 path_prefix = 'libs/ardour/'
34 'audio_diskstream.cc',
37 'audio_playlist_importer.cc',
39 'audio_region_importer.cc',
41 'audio_track_importer.cc',
44 'audiofile_tagger.cc',
51 'automation_control.cc',
53 'beats_frames_converter.cc',
61 'control_protocol_manager.cc',
62 'control_protocol_search_path.cc',
69 'element_import_handler.cc',
70 'element_importer.cc',
74 'export_channel_configuration.cc',
77 'export_format_base.cc',
78 'export_format_manager.cc',
79 'export_format_specification.cc',
83 'export_processor.cc',
84 'export_profile_manager.cc',
87 'export_utilities.cc',
89 'filename_extensions.cc',
90 'filesystem_paths.cc',
105 'location_importer.cc',
108 'midi_clock_slave.cc',
109 'midi_diskstream.cc',
111 'midi_patch_manager.cc',
115 'midi_ring_buffer.cc',
117 'midi_state_tracker.cc',
123 'named_selection.cc',
128 'playlist_factory.cc',
137 'rc_configuration.cc',
138 'recent_sessions.cc',
141 'resampled_source.cc',
151 'session_command.cc',
152 'session_configuration.cc',
153 'session_directory.cc',
156 'session_metadata.cc',
158 'session_process.cc',
160 'session_state_utils.cc',
162 'session_transport.cc',
165 'sndfile_helpers.cc',
166 'sndfileimportable.cc',
172 'tape_file_matcher.cc',
175 'tempo_map_importer.cc',
178 'transient_detector.cc',
184 def set_options(opt):
185 autowaf.set_options(opt)
188 autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
189 'libardour3', MAJOR, MINOR, MICRO)
190 autowaf.configure(conf)
191 autowaf.check_tool(conf, 'compiler_cxx gas')
192 autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
193 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
194 autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
195 autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
196 autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
197 autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
198 autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
199 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
200 autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
201 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
202 autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
203 autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
205 # we don't try to detect this, since its part of our source tree
207 conf.define('HAVE_RUBBERBAND', 1) # controls whether we think we have it
208 conf.define('USE_RUBBERBAND', 1) # controls whether we actually use it
210 conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H')
211 conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP')
213 if conf.env['IS_OSX']:
214 conf.check_cc (header_name = '/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h',
215 linkflags = [ '-framework', 'CoreMIDI' ])
217 conf.check_cc (header_name = '/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h',
218 linkflags = [ '-framework', 'AudioToolbox' ])
220 conf.check_cc (header_name = '/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h',
221 define_name = 'HAVE_COREAUDIO')
223 conf.check_cc (header_name = '/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h',
224 define_name = 'HAVE_AUDIOUNITS', linkflags = [ '-framework', 'AudioUnit' ])
226 conf.write_config_header('libardour-config.h')
229 autowaf.check_header(conf, 'boost/shared_ptr.hpp')
230 autowaf.check_header(conf, 'boost/weak_ptr.hpp')
234 obj = bld.new_task_gen('cxx', 'shlib')
235 obj.source = libardour_sources
236 obj.export_incdirs = ['.']
237 obj.includes = ['.', '../surfaces/control_protocol']
238 obj.name = 'libardour'
239 obj.target = 'ardour'
240 obj.uselib = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF'
241 obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib librubberband'
242 obj.vnum = LIBARDOUR_LIB_VERSION
243 obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
244 obj.cxxflags = ['-DPACKAGE="libardour3"']
245 obj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
246 obj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
247 obj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
248 obj.cxxflags += ['-DLOCALEDIR="' + os.path.join(
249 os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
250 obj.cxxflags += ['-DVAMP_DIR="' + os.path.join(
251 os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
252 #obj.source += ' st_stretch.cc st_pitch.cc '
253 #obj.uselib += ' SOUNDTOUCH '
254 if bld.env['HAVE_SLV2']:
255 obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
256 obj.uselib += ' SLV2 '
259 obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ]
261 if bld.env['HAVE_COREAUDIO'] and bld.env['COREAUDIO']:
262 obj.sources += [ 'coreaudio.cc', 'caimportable.cc' ]
264 if bld.env['HAVE_AUDIOUNITS'] and bld.env['AUDIOUNITS']:
265 obj.sources += [ 'audio_unit.cc' ]
267 if bld.env['IS_OSX']:
268 # this avoids issues with circular dependencies between libardour and libardour_cp.
269 obj.linkflags += '-undefined suppress -flat_namespace'
271 if bld.env['FPU_OPTIMIZATION']:
272 obj.source += [ 'sse_functions_xmm.cc' ]
273 if bld.env['build_target'] == 'i386' or bld.env['build_target'] == 'i686':
274 obj.source += [ 'sse_functions.s' ]
275 elif bld.env['build_target'] == 'x86_64':
276 obj.source += [ 'sse_functions_64bit.s' ]
279 if bld.env['ENABLE_NLS']:
280 mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
282 lang = os.path.basename (mo).replace ('.mo', '')
283 bld.install_as (os.path.join (bld.env['PREFIX'], 'share', 'locale', lang, 'LC_MESSAGES', APPNAME + '.mo'), mo)
285 if bld.env['HAVE_CPPUNIT']:
287 testobj = bld.new_task_gen('cxx', 'program')
290 tests/interpolation-test.cc
293 testobj.includes = obj.includes + ['../pbd/']
294 testobj.uselib = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE'
295 testobj.target = 'run-tests'
296 testobj.install_path = ''
303 build_i18n (bld, 'libs/ardour', APPNAME, libardour_sources)