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
63 control_protocol_manager.cc
64 control_protocol_search_path.cc
71 element_import_handler.cc
75 export_channel_configuration.cc
79 export_format_manager.cc
80 export_format_specification.cc
85 export_profile_manager.cc
89 filename_extensions.cc
115 midi_state_tracker.cc
118 midi_patch_manager.cc
154 session_state_utils.cc
170 tempo_map_importer.cc
172 transient_detector.cc
178 arch_specific_objects = [ ]
180 osc_files = [ 'osc.cc' ]
181 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
182 lv2_files = [ 'lv2_plugin.cc' ]
183 audiounit_files = [ 'audio_unit.cc' ]
184 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
189 extra_sources += vst_files
190 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
193 extra_sources += lv2_files
194 ardour.Append(CCFLAGS="-DHAVE_SLV2")
197 extra_sources += osc_files
199 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
200 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
201 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
202 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
203 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
204 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
206 ardour.Merge ([ libraries['jack'] ])
209 # See if JACK supports jack_client_open()
212 jack_test_source_file = """
213 #include <jack/jack.h>
214 int main(int argc, char **argv)
216 jack_client_open ("foo", 0, 0);
220 def CheckJackClientOpen(context):
221 context.Message('Checking for jack_client_open()...')
222 result = context.TryLink(jack_test_source_file, '.c')
223 context.Result(result)
227 # See if JACK supports jack_recompute_total_latencies()
230 jack_test_source_file = """
231 #include <jack/jack.h>
232 int main(int argc, char **argv)
234 jack_recompute_total_latencies ((jack_client_t*) 0);
238 def CheckJackRecomputeLatencies(context):
239 context.Message('Checking for jack_recompute_total_latencies()...')
240 result = context.TryLink(jack_test_source_file, '.c')
241 context.Result(result)
244 jack_video_frame_offset_test = """
245 #include <jack/transport.h>
246 int main(int argc, char** argv)
250 pos.valid & JackVideoFrameOffset;
254 def CheckJackVideoFrameOffset(context):
255 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
256 result = context.TryLink(jack_video_frame_offset_test, '.c')
257 context.Result(result)
262 # See if JACK supports jack_recompute_total_latency() (single port version)
265 jack_port_latency_test = """
266 #include <jack/jack.h>
267 int main(int argc, char **argv)
269 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
273 def CheckJackRecomputeLatency(context):
274 context.Message('Checking for jack_recompute_total_latency()...')
275 result = context.TryLink(jack_port_latency_test, '.c')
276 context.Result(result)
279 conf = Configure(ardour, custom_tests = {
280 'CheckJackClientOpen' : CheckJackClientOpen,
281 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
282 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
283 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
286 if conf.CheckJackClientOpen():
287 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
289 if conf.CheckJackRecomputeLatencies():
290 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
292 if conf.CheckJackRecomputeLatency():
293 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
295 if conf.CheckJackVideoFrameOffset():
296 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
299 # Optional header files
302 if conf.CheckCHeader('wordexp.h'):
303 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
305 if conf.CheckCHeader('sys/vfs.h'):
306 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
308 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
309 ardour.Append(LINKFLAGS="-framework CoreMIDI")
311 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
312 ardour.Append(LINKFLAGS="-framework AudioToolbox")
314 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
315 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
317 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
318 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
319 ardour.Append(LINKFLAGS="-framework AudioUnit")
320 extra_sources += audiounit_files
322 if ardour['COREAUDIO']:
323 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
324 extra_sources += coreaudio_files
326 if env['CONFIG_ARCH'] == 'apple':
327 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
328 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
330 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
332 ardour = conf.Finish ()
339 libraries['glibmm2'],
341 libraries['midi++2'],
345 libraries['samplerate'],
347 libraries['sndfile'],
350 libraries['vamphost'],
354 if ardour['RUBBERBAND']:
355 ardour.Merge ([ libraries['rubberband']])
356 timefx_sources += [ 'rb_effect.cc' ]
358 ardour.Merge ([ libraries['soundtouch'] ])
359 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
362 ardour.Merge ([ libraries['slv2'] ])
365 ardour.Merge ([ libraries['lo'] ])
367 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
368 ardour.Merge ([ libraries['appleutility'] ])
370 def SharedAsmObjectEmitter(target, source, env):
372 tgt.attributes.shared = 1
373 return (target, source)
376 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
377 emitter = SharedAsmObjectEmitter,
378 suffix = '$SHOBJSUFFIX',
382 # handle objects that should always be compiled with -msse in their own
383 # special environment, which is exactly like "ardour" but unconditionally
388 always_sse_objects = []
389 sse_env = ardour.Clone()
390 sse_env.Append (CXXFLAGS="-msse")
392 if env['FPU_OPTIMIZATION']:
393 if env['DIST_TARGET'] == "i386":
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'] == "i686":
397 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
398 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
399 if env['DIST_TARGET'] == "x86_64":
400 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
401 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
403 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
408 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
411 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
413 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
415 env.Alias('tarball', env.Distribute (env['DISTTREE'],
416 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
417 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
418 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
425 glob.glob('po/*.po') + glob.glob('ardour/*.h')))