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
74 export_channel_configuration.cc
78 export_format_manager.cc
79 export_format_specification.cc
84 export_profile_manager.cc
88 filename_extensions.cc
114 midi_state_tracker.cc
152 session_state_utils.cc
167 tempo_map_importer.cc
169 transient_detector.cc
175 arch_specific_objects = [ ]
177 osc_files = [ 'osc.cc' ]
178 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
179 lv2_files = [ 'lv2_plugin.cc' ]
180 audiounit_files = [ 'audio_unit.cc' ]
181 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
186 extra_sources += vst_files
187 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
190 extra_sources += lv2_files
191 ardour.Append(CCFLAGS="-DHAVE_SLV2")
194 extra_sources += osc_files
196 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
197 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
198 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
199 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
200 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
201 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
203 ardour.Merge ([ libraries['jack'] ])
206 # See if JACK supports jack_client_open()
209 jack_test_source_file = """
210 #include <jack/jack.h>
211 int main(int argc, char **argv)
213 jack_client_open ("foo", 0, 0);
217 def CheckJackClientOpen(context):
218 context.Message('Checking for jack_client_open()...')
219 result = context.TryLink(jack_test_source_file, '.c')
220 context.Result(result)
224 # See if JACK supports jack_recompute_total_latencies()
227 jack_test_source_file = """
228 #include <jack/jack.h>
229 int main(int argc, char **argv)
231 jack_recompute_total_latencies ((jack_client_t*) 0);
235 def CheckJackRecomputeLatencies(context):
236 context.Message('Checking for jack_recompute_total_latencies()...')
237 result = context.TryLink(jack_test_source_file, '.c')
238 context.Result(result)
241 jack_video_frame_offset_test = """
242 #include <jack/transport.h>
243 int main(int argc, char** argv)
247 pos.valid & JackVideoFrameOffset;
251 def CheckJackVideoFrameOffset(context):
252 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
253 result = context.TryLink(jack_video_frame_offset_test, '.c')
254 context.Result(result)
259 # See if JACK supports jack_recompute_total_latency() (single port version)
262 jack_port_latency_test = """
263 #include <jack/jack.h>
264 int main(int argc, char **argv)
266 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
270 def CheckJackRecomputeLatency(context):
271 context.Message('Checking for jack_recompute_total_latency()...')
272 result = context.TryLink(jack_port_latency_test, '.c')
273 context.Result(result)
276 conf = Configure(ardour, custom_tests = {
277 'CheckJackClientOpen' : CheckJackClientOpen,
278 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
279 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
280 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
283 if conf.CheckJackClientOpen():
284 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
286 if conf.CheckJackRecomputeLatencies():
287 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
289 if conf.CheckJackRecomputeLatency():
290 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
292 if conf.CheckJackVideoFrameOffset():
293 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
296 # Optional header files
299 if conf.CheckCHeader('wordexp.h'):
300 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
302 if conf.CheckCHeader('sys/vfs.h'):
303 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
305 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
306 ardour.Append(LINKFLAGS="-framework CoreMIDI")
308 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
309 ardour.Append(LINKFLAGS="-framework AudioToolbox")
311 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
312 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
314 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
315 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
316 ardour.Append(LINKFLAGS="-framework AudioUnit")
317 extra_sources += audiounit_files
319 if ardour['COREAUDIO']:
320 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
321 extra_sources += coreaudio_files
323 if env['CONFIG_ARCH'] == 'apple':
324 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
325 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
327 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
329 ardour = conf.Finish ()
336 libraries['glibmm2'],
338 libraries['midi++2'],
342 libraries['samplerate'],
344 libraries['sndfile'],
347 libraries['vamphost'],
351 if ardour['RUBBERBAND']:
352 ardour.Merge ([ libraries['rubberband']])
353 timefx_sources += [ 'rb_effect.cc' ]
355 ardour.Merge ([ libraries['soundtouch'] ])
356 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
359 ardour.Merge ([ libraries['slv2'] ])
362 ardour.Merge ([ libraries['lo'] ])
364 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
365 ardour.Merge ([ libraries['appleutility'] ])
367 def SharedAsmObjectEmitter(target, source, env):
369 tgt.attributes.shared = 1
370 return (target, source)
373 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
374 emitter = SharedAsmObjectEmitter,
375 suffix = '$SHOBJSUFFIX',
379 # handle objects that should always be compiled with -msse in their own
380 # special environment, which is exactly like "ardour" but unconditionally
385 always_sse_objects = []
386 sse_env = ardour.Clone()
387 sse_env.Append (CXXFLAGS="-msse")
389 if env['FPU_OPTIMIZATION']:
390 if env['DIST_TARGET'] == "i386":
391 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
392 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
393 if env['DIST_TARGET'] == "i686":
394 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
395 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
396 if env['DIST_TARGET'] == "x86_64":
397 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
398 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
400 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
405 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
408 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
410 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
412 env.Alias('tarball', env.Distribute (env['DISTTREE'],
413 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
414 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
415 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
422 glob.glob('po/*.po') + glob.glob('ardour/*.h')))