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
153 session_state_utils.cc
169 tempo_map_importer.cc
171 transient_detector.cc
177 arch_specific_objects = [ ]
179 osc_files = [ 'osc.cc' ]
180 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
181 lv2_files = [ 'lv2_plugin.cc' ]
182 audiounit_files = [ 'audio_unit.cc' ]
183 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
188 extra_sources += vst_files
189 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
192 extra_sources += lv2_files
193 ardour.Append(CCFLAGS="-DHAVE_SLV2")
196 extra_sources += osc_files
198 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
199 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
200 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
201 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour3', 'vamp') + "\\\"")
202 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
203 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
205 ardour.Merge ([ libraries['jack'] ])
208 # See if JACK supports jack_client_open()
211 jack_test_source_file = """
212 #include <jack/jack.h>
213 int main(int argc, char **argv)
215 jack_client_open ("foo", 0, 0);
219 def CheckJackClientOpen(context):
220 context.Message('Checking for jack_client_open()...')
221 result = context.TryLink(jack_test_source_file, '.c')
222 context.Result(result)
226 # See if JACK supports jack_recompute_total_latencies()
229 jack_test_source_file = """
230 #include <jack/jack.h>
231 int main(int argc, char **argv)
233 jack_recompute_total_latencies ((jack_client_t*) 0);
237 def CheckJackRecomputeLatencies(context):
238 context.Message('Checking for jack_recompute_total_latencies()...')
239 result = context.TryLink(jack_test_source_file, '.c')
240 context.Result(result)
243 jack_video_frame_offset_test = """
244 #include <jack/transport.h>
245 int main(int argc, char** argv)
249 pos.valid & JackVideoFrameOffset;
253 def CheckJackVideoFrameOffset(context):
254 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
255 result = context.TryLink(jack_video_frame_offset_test, '.c')
256 context.Result(result)
261 # See if JACK supports jack_recompute_total_latency() (single port version)
264 jack_port_latency_test = """
265 #include <jack/jack.h>
266 int main(int argc, char **argv)
268 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
272 def CheckJackRecomputeLatency(context):
273 context.Message('Checking for jack_recompute_total_latency()...')
274 result = context.TryLink(jack_port_latency_test, '.c')
275 context.Result(result)
278 conf = Configure(ardour, custom_tests = {
279 'CheckJackClientOpen' : CheckJackClientOpen,
280 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
281 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
282 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
285 if conf.CheckJackClientOpen():
286 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
288 if conf.CheckJackRecomputeLatencies():
289 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
291 if conf.CheckJackRecomputeLatency():
292 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
294 if conf.CheckJackVideoFrameOffset():
295 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
298 # Optional header files
301 if conf.CheckCHeader('wordexp.h'):
302 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
304 if conf.CheckCHeader('sys/vfs.h'):
305 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
307 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
308 ardour.Append(LINKFLAGS="-framework CoreMIDI")
310 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
311 ardour.Append(LINKFLAGS="-framework AudioToolbox")
313 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
314 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
316 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
317 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
318 ardour.Append(LINKFLAGS="-framework AudioUnit")
319 extra_sources += audiounit_files
321 if ardour['COREAUDIO']:
322 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
323 extra_sources += coreaudio_files
325 if env['CONFIG_ARCH'] == 'apple':
326 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
327 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
329 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
331 ardour = conf.Finish ()
338 libraries['glibmm2'],
340 libraries['midi++2'],
344 libraries['samplerate'],
346 libraries['sndfile'],
349 libraries['vamphost'],
353 if ardour['RUBBERBAND']:
354 ardour.Merge ([ libraries['rubberband']])
355 timefx_sources += [ 'rb_effect.cc' ]
357 ardour.Merge ([ libraries['soundtouch'] ])
358 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
361 ardour.Merge ([ libraries['slv2'] ])
364 ardour.Merge ([ libraries['lo'] ])
366 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
367 ardour.Merge ([ libraries['appleutility'] ])
369 def SharedAsmObjectEmitter(target, source, env):
371 tgt.attributes.shared = 1
372 return (target, source)
375 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
376 emitter = SharedAsmObjectEmitter,
377 suffix = '$SHOBJSUFFIX',
381 # handle objects that should always be compiled with -msse in their own
382 # special environment, which is exactly like "ardour" but unconditionally
387 always_sse_objects = []
388 sse_env = ardour.Clone()
389 sse_env.Append (CXXFLAGS="-msse")
391 if env['FPU_OPTIMIZATION']:
392 if env['DIST_TARGET'] == "i386":
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'] == "i686":
396 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
397 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
398 if env['DIST_TARGET'] == "x86_64":
399 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
400 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
402 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
407 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
410 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour3'), libardour))
412 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
414 env.Alias('tarball', env.Distribute (env['DISTTREE'],
415 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
416 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
417 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
424 glob.glob('po/*.po') + glob.glob('ardour/*.h')))