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
41 audio_region_importer.cc
43 audio_track_importer.cc
55 beats_frames_converter.cc
63 control_protocol_manager.cc
64 control_protocol_search_path.cc
71 element_import_handler.cc
76 export_channel_configuration.cc
80 export_format_manager.cc
81 export_format_specification.cc
86 export_profile_manager.cc
91 filename_extensions.cc
113 midi_patch_manager.cc
119 midi_state_tracker.cc
153 session_configuration.cc
161 session_state_utils.cc
176 tempo_map_importer.cc
179 transient_detector.cc
185 arch_specific_objects = [ ]
187 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
188 lv2_files = [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
189 audiounit_files = [ 'audio_unit.cc' ]
190 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
195 extra_sources += vst_files
196 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
199 extra_sources += lv2_files
200 ardour.Append(CCFLAGS="-DHAVE_SLV2")
202 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
203 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
204 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
205 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
206 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
207 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
209 ardour.Merge ([ libraries['jack'] ])
212 # See if JACK supports jack_client_open()
215 jack_test_source_file = """
216 #include <jack/jack.h>
217 int main(int argc, char **argv)
219 jack_client_open ("foo", 0, 0);
223 def CheckJackClientOpen(context):
224 context.Message('Checking for jack_client_open()...')
225 result = context.TryLink(jack_test_source_file, '.c')
226 context.Result(result)
230 # See if JACK supports jack_recompute_total_latencies()
233 jack_test_source_file = """
234 #include <jack/jack.h>
235 int main(int argc, char **argv)
237 jack_recompute_total_latencies ((jack_client_t*) 0);
241 def CheckJackRecomputeLatencies(context):
242 context.Message('Checking for jack_recompute_total_latencies()...')
243 result = context.TryLink(jack_test_source_file, '.c')
244 context.Result(result)
247 jack_video_frame_offset_test = """
248 #include <jack/transport.h>
249 int main(int argc, char** argv)
253 pos.valid & JackVideoFrameOffset;
257 def CheckJackVideoFrameOffset(context):
258 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
259 result = context.TryLink(jack_video_frame_offset_test, '.c')
260 context.Result(result)
265 # See if JACK supports jack_recompute_total_latency() (single port version)
268 jack_port_latency_test = """
269 #include <jack/jack.h>
270 int main(int argc, char **argv)
272 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
276 def CheckJackRecomputeLatency(context):
277 context.Message('Checking for jack_recompute_total_latency()...')
278 result = context.TryLink(jack_port_latency_test, '.c')
279 context.Result(result)
282 conf = Configure(ardour, custom_tests = {
283 'CheckJackClientOpen' : CheckJackClientOpen,
284 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
285 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
286 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
289 if conf.CheckJackClientOpen():
290 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
292 if conf.CheckJackRecomputeLatencies():
293 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
295 if conf.CheckJackRecomputeLatency():
296 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
298 if conf.CheckJackVideoFrameOffset():
299 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
302 # Optional header files
305 if conf.CheckCHeader('wordexp.h'):
306 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
308 if conf.CheckCHeader('sys/vfs.h'):
309 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
311 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
312 ardour.Append(LINKFLAGS="-framework CoreMIDI")
314 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
315 ardour.Append(LINKFLAGS="-framework AudioToolbox")
317 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
318 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
320 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
321 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
322 ardour.Append(LINKFLAGS="-framework AudioUnit")
323 extra_sources += audiounit_files
325 if ardour['COREAUDIO']:
326 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
327 extra_sources += coreaudio_files
329 if env['CONFIG_ARCH'] == 'apple':
330 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
331 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
333 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
335 ardour = conf.Finish ()
342 libraries['glibmm2'],
344 libraries['midi++2'],
349 libraries['samplerate'],
351 libraries['sndfile'],
354 libraries['vamphost'],
358 if ardour['RUBBERBAND']:
359 ardour.Merge ([ libraries['rubberband']])
360 timefx_sources += [ 'rb_effect.cc' ]
362 ardour.Merge ([ libraries['soundtouch'] ])
363 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
366 ardour.Merge ([ libraries['slv2'] ])
368 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
369 ardour.Merge ([ libraries['appleutility'] ])
371 def SharedAsmObjectEmitter(target, source, env):
373 tgt.attributes.shared = 1
374 return (target, source)
377 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
378 emitter = SharedAsmObjectEmitter,
379 suffix = '$SHOBJSUFFIX',
383 # handle objects that should always be compiled with -msse in their own
384 # special environment, which is exactly like "ardour" but unconditionally
389 always_sse_objects = []
390 sse_env = ardour.Clone()
391 sse_env.Append (CXXFLAGS="-msse")
393 if env['FPU_OPTIMIZATION']:
394 if env['DIST_TARGET'] == "i386":
395 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
396 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
397 if env['DIST_TARGET'] == "i686":
398 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
399 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
400 if env['DIST_TARGET'] == "x86_64":
401 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
402 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
404 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
409 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
412 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
414 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
416 env.Alias('tarball', env.Distribute (env['DISTTREE'],
417 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
418 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
419 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
425 glob.glob('po/*.po') + glob.glob('ardour/*.h')))