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
47 audio_region_importer.cc
62 control_protocol_manager.cc
63 control_protocol_search_path.cc
70 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
150 session_state_utils.cc
165 tempo_map_importer.cc
167 transient_detector.cc
173 arch_specific_objects = [ ]
175 osc_files = [ 'osc.cc' ]
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")
192 extra_sources += osc_files
194 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
195 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
196 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
197 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
198 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
199 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
201 ardour.Merge ([ libraries['jack'] ])
204 # See if JACK supports jack_client_open()
207 jack_test_source_file = """
208 #include <jack/jack.h>
209 int main(int argc, char **argv)
211 jack_client_open ("foo", 0, 0);
215 def CheckJackClientOpen(context):
216 context.Message('Checking for jack_client_open()...')
217 result = context.TryLink(jack_test_source_file, '.c')
218 context.Result(result)
222 # See if JACK supports jack_recompute_total_latencies()
225 jack_test_source_file = """
226 #include <jack/jack.h>
227 int main(int argc, char **argv)
229 jack_recompute_total_latencies ((jack_client_t*) 0);
233 def CheckJackRecomputeLatencies(context):
234 context.Message('Checking for jack_recompute_total_latencies()...')
235 result = context.TryLink(jack_test_source_file, '.c')
236 context.Result(result)
239 jack_video_frame_offset_test = """
240 #include <jack/transport.h>
241 int main(int argc, char** argv)
245 pos.valid & JackVideoFrameOffset;
249 def CheckJackVideoFrameOffset(context):
250 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
251 result = context.TryLink(jack_video_frame_offset_test, '.c')
252 context.Result(result)
257 # See if JACK supports jack_recompute_total_latency() (single port version)
260 jack_port_latency_test = """
261 #include <jack/jack.h>
262 int main(int argc, char **argv)
264 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
268 def CheckJackRecomputeLatency(context):
269 context.Message('Checking for jack_recompute_total_latency()...')
270 result = context.TryLink(jack_port_latency_test, '.c')
271 context.Result(result)
274 conf = Configure(ardour, custom_tests = {
275 'CheckJackClientOpen' : CheckJackClientOpen,
276 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
277 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
278 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
281 if conf.CheckJackClientOpen():
282 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
284 if conf.CheckJackRecomputeLatencies():
285 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
287 if conf.CheckJackRecomputeLatency():
288 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
290 if conf.CheckJackVideoFrameOffset():
291 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
294 # Optional header files
297 if conf.CheckCHeader('wordexp.h'):
298 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
300 if conf.CheckCHeader('sys/vfs.h'):
301 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
303 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
304 ardour.Append(LINKFLAGS="-framework CoreMIDI")
306 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
307 ardour.Append(LINKFLAGS="-framework AudioToolbox")
309 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
310 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
312 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
313 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
314 ardour.Append(LINKFLAGS="-framework AudioUnit")
315 extra_sources += audiounit_files
317 if ardour['COREAUDIO']:
318 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
319 extra_sources += coreaudio_files
321 if env['CONFIG_ARCH'] == 'apple':
322 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
323 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
325 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
327 ardour = conf.Finish ()
334 libraries['glibmm2'],
336 libraries['midi++2'],
340 libraries['samplerate'],
342 libraries['sndfile'],
345 libraries['vamphost'],
349 if ardour['RUBBERBAND']:
350 ardour.Merge ([ libraries['rubberband']])
351 timefx_sources += [ 'rb_effect.cc' ]
353 ardour.Merge ([ libraries['soundtouch'] ])
354 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
357 ardour.Merge ([ libraries['slv2'] ])
360 ardour.Merge ([ libraries['lo'] ])
362 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
363 ardour.Merge ([ libraries['appleutility'] ])
365 def SharedAsmObjectEmitter(target, source, env):
367 tgt.attributes.shared = 1
368 return (target, source)
371 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
372 emitter = SharedAsmObjectEmitter,
373 suffix = '$SHOBJSUFFIX',
377 # handle objects that should always be compiled with -msse in their own
378 # special environment, which is exactly like "ardour" but unconditionally
383 always_sse_objects = []
384 sse_env = ardour.Clone()
385 sse_env.Append (CXXFLAGS="-msse")
387 if env['FPU_OPTIMIZATION']:
388 if env['DIST_TARGET'] == "i386":
389 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
390 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
391 if env['DIST_TARGET'] == "i686":
392 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
393 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
394 if env['DIST_TARGET'] == "x86_64":
395 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
396 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
398 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
403 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
406 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
408 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
410 env.Alias('tarball', env.Distribute (env['DISTTREE'],
411 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
412 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
413 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
420 glob.glob('po/*.po') + glob.glob('ardour/*.h')))