7 Import('env final_prefix install_prefix final_config_prefix libraries i18n')
12 # this defines the version number of libardour
17 ardour.Append(DOMAIN = domain, MAJOR = 3, MINOR = 0, MICRO = 0)
18 ardour.Append(CXXFLAGS = "-DPACKAGE=\\\"" + domain + "\\\"")
19 ardour.Append(CXXFLAGS=["-DLIBSIGC_DISABLE_DEPRECATED", "-DGLIBMM_EXCEPTIONS_ENABLED"])
20 ardour.Append(PACKAGE = domain)
21 ardour.Append(POTFILE = domain + '.pot')
24 ardour.Append (LINKFLAGS="-Xlinker -headerpad -Xlinker 2048")
27 # explicitly reference the control protocol LGPL library for includes
30 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
32 ardour_files=Split("""
39 audio_playlist_importer.cc
42 audio_track_importer.cc
48 audio_region_importer.cc
61 control_protocol_manager.cc
62 control_protocol_search_path.cc
69 element_import_handler.cc
73 export_channel_configuration.cc
77 export_format_manager.cc
78 export_format_specification.cc
83 export_profile_manager.cc
87 filename_extensions.cc
106 midi_patch_manager.cc
112 midi_state_tracker.cc
150 session_state_utils.cc
166 tempo_map_importer.cc
168 transient_detector.cc
174 arch_specific_objects = [ ]
176 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
177 lv2_files = [ 'lv2_plugin.cc' ]
178 audiounit_files = [ 'audio_unit.cc' ]
179 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
184 extra_sources += vst_files
185 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
188 extra_sources += lv2_files
189 ardour.Append(CCFLAGS="-DHAVE_SLV2")
191 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
192 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
193 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
194 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
195 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
196 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
198 ardour.Merge ([ libraries['jack'] ])
201 # See if JACK supports jack_client_open()
204 jack_test_source_file = """
205 #include <jack/jack.h>
206 int main(int argc, char **argv)
208 jack_client_open ("foo", 0, 0);
212 def CheckJackClientOpen(context):
213 context.Message('Checking for jack_client_open()...')
214 result = context.TryLink(jack_test_source_file, '.c')
215 context.Result(result)
219 # See if JACK supports jack_recompute_total_latencies()
222 jack_test_source_file = """
223 #include <jack/jack.h>
224 int main(int argc, char **argv)
226 jack_recompute_total_latencies ((jack_client_t*) 0);
230 def CheckJackRecomputeLatencies(context):
231 context.Message('Checking for jack_recompute_total_latencies()...')
232 result = context.TryLink(jack_test_source_file, '.c')
233 context.Result(result)
236 jack_video_frame_offset_test = """
237 #include <jack/transport.h>
238 int main(int argc, char** argv)
242 pos.valid & JackVideoFrameOffset;
246 def CheckJackVideoFrameOffset(context):
247 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
248 result = context.TryLink(jack_video_frame_offset_test, '.c')
249 context.Result(result)
254 # See if JACK supports jack_recompute_total_latency() (single port version)
257 jack_port_latency_test = """
258 #include <jack/jack.h>
259 int main(int argc, char **argv)
261 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
265 def CheckJackRecomputeLatency(context):
266 context.Message('Checking for jack_recompute_total_latency()...')
267 result = context.TryLink(jack_port_latency_test, '.c')
268 context.Result(result)
271 conf = Configure(ardour, custom_tests = {
272 'CheckJackClientOpen' : CheckJackClientOpen,
273 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
274 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
275 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
278 if conf.CheckJackClientOpen():
279 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
281 if conf.CheckJackRecomputeLatencies():
282 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
284 if conf.CheckJackRecomputeLatency():
285 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
287 if conf.CheckJackVideoFrameOffset():
288 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
291 # Optional header files
294 if conf.CheckCHeader('wordexp.h'):
295 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
297 if conf.CheckCHeader('sys/vfs.h'):
298 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
300 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
301 ardour.Append(LINKFLAGS="-framework CoreMIDI")
303 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
304 ardour.Append(LINKFLAGS="-framework AudioToolbox")
306 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
307 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
309 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
310 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
311 ardour.Append(LINKFLAGS="-framework AudioUnit")
312 extra_sources += audiounit_files
314 if ardour['COREAUDIO']:
315 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
316 extra_sources += coreaudio_files
318 if env['CONFIG_ARCH'] == 'apple':
319 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
320 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
322 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
324 ardour = conf.Finish ()
331 libraries['glibmm2'],
333 libraries['midi++2'],
338 libraries['samplerate'],
340 libraries['sndfile'],
343 libraries['vamphost'],
347 if ardour['RUBBERBAND']:
348 ardour.Merge ([ libraries['rubberband']])
349 timefx_sources += [ 'rb_effect.cc' ]
351 ardour.Merge ([ libraries['soundtouch'] ])
352 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
355 ardour.Merge ([ libraries['slv2'] ])
357 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
358 ardour.Merge ([ libraries['appleutility'] ])
360 def SharedAsmObjectEmitter(target, source, env):
362 tgt.attributes.shared = 1
363 return (target, source)
366 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
367 emitter = SharedAsmObjectEmitter,
368 suffix = '$SHOBJSUFFIX',
372 # handle objects that should always be compiled with -msse in their own
373 # special environment, which is exactly like "ardour" but unconditionally
378 always_sse_objects = []
379 sse_env = ardour.Clone()
380 sse_env.Append (CXXFLAGS="-msse")
382 if env['FPU_OPTIMIZATION']:
383 if env['DIST_TARGET'] == "i386":
384 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
385 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
386 if env['DIST_TARGET'] == "i686":
387 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
388 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
389 if env['DIST_TARGET'] == "x86_64":
390 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
391 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
393 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
398 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
401 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
403 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
405 env.Alias('tarball', env.Distribute (env['DISTTREE'],
406 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
407 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
408 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
414 glob.glob('po/*.po') + glob.glob('ardour/*.h')))