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")
20 ardour.Append(PACKAGE = domain)
21 ardour.Append(POTFILE = domain + '.pot')
24 # explicitly reference the control protocol LGPL library for includes
27 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
29 ardour_files=Split("""
52 control_protocol_manager.cc
53 control_protocol_search_path.cc
61 filename_extensions.cc
70 internal_audio_port.cc
122 session_state_utils.cc
141 arch_specific_objects = [ ]
143 osc_files = [ 'osc.cc' ]
144 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
145 audiounit_files = [ 'audio_unit.cc' ]
146 coreaudio_files = [ 'coreaudiosource.cc' ]
150 extra_sources += vst_files
151 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
154 extra_sources += osc_files
156 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
157 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
158 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
159 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
160 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
162 ardour.Merge ([ libraries['jack'] ])
165 # See if JACK supports jack_client_open()
168 jack_test_source_file = """
169 #include <jack/jack.h>
170 int main(int argc, char **argv)
172 jack_client_open ("foo", 0, 0);
176 def CheckJackClientOpen(context):
177 context.Message('Checking for jack_client_open()...')
178 result = context.TryLink(jack_test_source_file, '.c')
179 context.Result(result)
183 # See if JACK supports jack_recompute_total_latencies()
186 jack_test_source_file = """
187 #include <jack/jack.h>
188 int main(int argc, char **argv)
190 jack_recompute_total_latencies ((jack_client_t*) 0);
194 def CheckJackRecomputeLatencies(context):
195 context.Message('Checking for jack_recompute_total_latencies()...')
196 result = context.TryLink(jack_test_source_file, '.c')
197 context.Result(result)
200 jack_video_frame_offset_test = """
201 #include <jack/transport.h>
202 int main(int argc, char** argv)
206 pos.valid & JackVideoFrameOffset;
210 def CheckJackVideoFrameOffset(context):
211 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
212 result = context.TryLink(jack_video_frame_offset_test, '.c')
213 context.Result(result)
218 # See if JACK supports jack_recompute_total_latency() (single port version)
221 jack_port_latency_test = """
222 #include <jack/jack.h>
223 int main(int argc, char **argv)
225 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
229 def CheckJackRecomputeLatency(context):
230 context.Message('Checking for jack_recompute_total_latency()...')
231 result = context.TryLink(jack_port_latency_test, '.c')
232 context.Result(result)
236 # See if JACK supports jack_port_ensure_monitor_input()
238 jack_ensure_monitor_input_test = """
239 #include <jack/jack.h>
240 int main(int argc, char** argv)
244 jack_port_ensure_monitor (*port, 1);
250 def CheckJackEnsureMonitorInput(context):
251 context.Message('Checking for jack_port_ensure_monitor_input()...')
252 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
253 context.Result(result)
256 conf = Configure(ardour, custom_tests = {
257 'CheckJackClientOpen' : CheckJackClientOpen,
258 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
259 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
260 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
261 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
264 if conf.CheckJackClientOpen():
265 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
267 if conf.CheckJackRecomputeLatencies():
268 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
270 if conf.CheckJackRecomputeLatency():
271 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
273 if conf.CheckJackVideoFrameOffset():
274 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
276 if conf.CheckJackEnsureMonitorInput():
277 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
279 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
282 # Optional header files
285 if conf.CheckCHeader('wordexp.h'):
286 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
288 if conf.CheckCHeader('sys/vfs.h'):
289 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
291 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
292 ardour.Append(LINKFLAGS="-framework CoreMIDI")
294 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
295 ardour.Append(LINKFLAGS="-framework AudioToolbox")
297 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
298 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
300 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
301 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
302 ardour.Append(LINKFLAGS="-framework AudioUnit")
303 extra_sources += audiounit_files
305 if ardour['COREAUDIO']:
306 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
307 extra_sources += coreaudio_files
309 if env['CONFIG_ARCH'] == 'apple':
310 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
311 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
313 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
315 ardour = conf.Finish ()
320 libraries['sndfile-ardour'],
323 libraries['samplerate'],
326 libraries['soundtouch'],
327 libraries['midi++2'],
333 ardour.Merge ([ libraries['lo'] ])
335 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
336 ardour.Merge ([ libraries['appleutility'] ])
338 def SharedAsmObjectEmitter(target, source, env):
340 tgt.attributes.shared = 1
341 return (target, source)
344 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
345 emitter = SharedAsmObjectEmitter,
346 suffix = '$SHOBJSUFFIX',
350 # handle objects that should always be compiled with -msse in their own
351 # special environment, which is exactly like "ardour" but unconditionally
356 always_sse_objects = []
357 sse_env = ardour.Copy()
358 sse_env.Append (CXXFLAGS="-msse")
360 if env['FPU_OPTIMIZATION']:
361 if env['DIST_TARGET'] == "i386":
362 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
363 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
364 if env['DIST_TARGET'] == "i686":
365 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
366 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
367 if env['DIST_TARGET'] == "x86_64":
368 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
369 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
371 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
376 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
379 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
381 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
383 env.Alias('tarball', env.Distribute (env['DISTTREE'],
384 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
385 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
386 glob.glob('po/*.po') + glob.glob('ardour/*.h')))