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
107 midi_patch_manager.cc
113 midi_state_tracker.cc
151 session_state_utils.cc
167 tempo_map_importer.cc
169 transient_detector.cc
175 arch_specific_objects = [ ]
177 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
178 lv2_files = [ 'lv2_plugin.cc' ]
179 audiounit_files = [ 'audio_unit.cc' ]
180 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
185 extra_sources += vst_files
186 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
189 extra_sources += lv2_files
190 ardour.Append(CCFLAGS="-DHAVE_SLV2")
192 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
193 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
194 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
195 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
196 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
197 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
199 ardour.Merge ([ libraries['jack'] ])
202 # See if JACK supports jack_client_open()
205 jack_test_source_file = """
206 #include <jack/jack.h>
207 int main(int argc, char **argv)
209 jack_client_open ("foo", 0, 0);
213 def CheckJackClientOpen(context):
214 context.Message('Checking for jack_client_open()...')
215 result = context.TryLink(jack_test_source_file, '.c')
216 context.Result(result)
220 # See if JACK supports jack_recompute_total_latencies()
223 jack_test_source_file = """
224 #include <jack/jack.h>
225 int main(int argc, char **argv)
227 jack_recompute_total_latencies ((jack_client_t*) 0);
231 def CheckJackRecomputeLatencies(context):
232 context.Message('Checking for jack_recompute_total_latencies()...')
233 result = context.TryLink(jack_test_source_file, '.c')
234 context.Result(result)
237 jack_video_frame_offset_test = """
238 #include <jack/transport.h>
239 int main(int argc, char** argv)
243 pos.valid & JackVideoFrameOffset;
247 def CheckJackVideoFrameOffset(context):
248 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
249 result = context.TryLink(jack_video_frame_offset_test, '.c')
250 context.Result(result)
255 # See if JACK supports jack_recompute_total_latency() (single port version)
258 jack_port_latency_test = """
259 #include <jack/jack.h>
260 int main(int argc, char **argv)
262 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
266 def CheckJackRecomputeLatency(context):
267 context.Message('Checking for jack_recompute_total_latency()...')
268 result = context.TryLink(jack_port_latency_test, '.c')
269 context.Result(result)
272 conf = Configure(ardour, custom_tests = {
273 'CheckJackClientOpen' : CheckJackClientOpen,
274 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
275 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
276 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
279 if conf.CheckJackClientOpen():
280 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
282 if conf.CheckJackRecomputeLatencies():
283 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
285 if conf.CheckJackRecomputeLatency():
286 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
288 if conf.CheckJackVideoFrameOffset():
289 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
292 # Optional header files
295 if conf.CheckCHeader('wordexp.h'):
296 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
298 if conf.CheckCHeader('sys/vfs.h'):
299 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
301 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
302 ardour.Append(LINKFLAGS="-framework CoreMIDI")
304 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
305 ardour.Append(LINKFLAGS="-framework AudioToolbox")
307 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
308 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
310 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
311 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
312 ardour.Append(LINKFLAGS="-framework AudioUnit")
313 extra_sources += audiounit_files
315 if ardour['COREAUDIO']:
316 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
317 extra_sources += coreaudio_files
319 if env['CONFIG_ARCH'] == 'apple':
320 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
321 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
323 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
325 ardour = conf.Finish ()
332 libraries['glibmm2'],
334 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')))