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 = 2, 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
166 tempo_map_importer.cc
168 transient_detector.cc
174 arch_specific_objects = [ ]
176 osc_files = [ 'osc.cc' ]
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")
193 extra_sources += osc_files
195 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
196 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
197 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
198 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
199 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
200 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
202 ardour.Merge ([ libraries['jack'] ])
205 # See if JACK supports jack_client_open()
208 jack_test_source_file = """
209 #include <jack/jack.h>
210 int main(int argc, char **argv)
212 jack_client_open ("foo", 0, 0);
216 def CheckJackClientOpen(context):
217 context.Message('Checking for jack_client_open()...')
218 result = context.TryLink(jack_test_source_file, '.c')
219 context.Result(result)
223 # See if JACK supports jack_recompute_total_latencies()
226 jack_test_source_file = """
227 #include <jack/jack.h>
228 int main(int argc, char **argv)
230 jack_recompute_total_latencies ((jack_client_t*) 0);
234 def CheckJackRecomputeLatencies(context):
235 context.Message('Checking for jack_recompute_total_latencies()...')
236 result = context.TryLink(jack_test_source_file, '.c')
237 context.Result(result)
240 jack_video_frame_offset_test = """
241 #include <jack/transport.h>
242 int main(int argc, char** argv)
246 pos.valid & JackVideoFrameOffset;
250 def CheckJackVideoFrameOffset(context):
251 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
252 result = context.TryLink(jack_video_frame_offset_test, '.c')
253 context.Result(result)
258 # See if JACK supports jack_recompute_total_latency() (single port version)
261 jack_port_latency_test = """
262 #include <jack/jack.h>
263 int main(int argc, char **argv)
265 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
269 def CheckJackRecomputeLatency(context):
270 context.Message('Checking for jack_recompute_total_latency()...')
271 result = context.TryLink(jack_port_latency_test, '.c')
272 context.Result(result)
275 conf = Configure(ardour, custom_tests = {
276 'CheckJackClientOpen' : CheckJackClientOpen,
277 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
278 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
279 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
282 if conf.CheckJackClientOpen():
283 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
285 if conf.CheckJackRecomputeLatencies():
286 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
288 if conf.CheckJackRecomputeLatency():
289 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
291 if conf.CheckJackVideoFrameOffset():
292 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
295 # Optional header files
298 if conf.CheckCHeader('wordexp.h'):
299 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
301 if conf.CheckCHeader('sys/vfs.h'):
302 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
304 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
305 ardour.Append(LINKFLAGS="-framework CoreMIDI")
307 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
308 ardour.Append(LINKFLAGS="-framework AudioToolbox")
310 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
311 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
313 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
314 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
315 ardour.Append(LINKFLAGS="-framework AudioUnit")
316 extra_sources += audiounit_files
318 if ardour['COREAUDIO']:
319 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
320 extra_sources += coreaudio_files
322 if env['CONFIG_ARCH'] == 'apple':
323 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
324 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
326 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
328 ardour = conf.Finish ()
335 libraries['glibmm2'],
337 libraries['midi++2'],
341 libraries['samplerate'],
343 libraries['sndfile'],
346 libraries['vamphost'],
350 if ardour['RUBBERBAND']:
351 ardour.Merge ([ libraries['rubberband']])
352 timefx_sources += [ 'rb_effect.cc' ]
354 ardour.Merge ([ libraries['soundtouch'] ])
355 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
358 ardour.Merge ([ libraries['slv2'] ])
361 ardour.Merge ([ libraries['lo'] ])
363 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
364 ardour.Merge ([ libraries['appleutility'] ])
366 def SharedAsmObjectEmitter(target, source, env):
368 tgt.attributes.shared = 1
369 return (target, source)
372 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
373 emitter = SharedAsmObjectEmitter,
374 suffix = '$SHOBJSUFFIX',
378 # handle objects that should always be compiled with -msse in their own
379 # special environment, which is exactly like "ardour" but unconditionally
384 always_sse_objects = []
385 sse_env = ardour.Clone()
386 sse_env.Append (CXXFLAGS="-msse")
388 if env['FPU_OPTIMIZATION']:
389 if env['DIST_TARGET'] == "i386":
390 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
391 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
392 if env['DIST_TARGET'] == "i686":
393 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
394 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
395 if env['DIST_TARGET'] == "x86_64":
396 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
397 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
399 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
404 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
407 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
409 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
411 env.Alias('tarball', env.Distribute (env['DISTTREE'],
412 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
413 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
414 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
421 glob.glob('po/*.po') + glob.glob('ardour/*.h')))