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("""
51 control_protocol_manager.cc
52 control_protocol_search_path.cc
60 filename_extensions.cc
69 internal_audio_port.cc
121 session_state_utils.cc
140 arch_specific_objects = [ ]
142 osc_files = [ 'osc.cc' ]
143 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
144 audiounit_files = [ 'audio_unit.cc' ]
145 coreaudio_files = [ 'coreaudiosource.cc' ]
149 extra_sources += vst_files
150 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
153 extra_sources += osc_files
155 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
156 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
157 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
158 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
159 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
161 ardour.Merge ([ libraries['jack'] ])
164 # See if JACK supports jack_client_open()
167 jack_test_source_file = """
168 #include <jack/jack.h>
169 int main(int argc, char **argv)
171 jack_client_open ("foo", 0, 0);
175 def CheckJackClientOpen(context):
176 context.Message('Checking for jack_client_open()...')
177 result = context.TryLink(jack_test_source_file, '.c')
178 context.Result(result)
182 # See if JACK supports jack_recompute_total_latencies()
185 jack_test_source_file = """
186 #include <jack/jack.h>
187 int main(int argc, char **argv)
189 jack_recompute_total_latencies ((jack_client_t*) 0);
193 def CheckJackRecomputeLatencies(context):
194 context.Message('Checking for jack_recompute_total_latencies()...')
195 result = context.TryLink(jack_test_source_file, '.c')
196 context.Result(result)
199 jack_video_frame_offset_test = """
200 #include <jack/transport.h>
201 int main(int argc, char** argv)
205 pos.valid & JackVideoFrameOffset;
209 def CheckJackVideoFrameOffset(context):
210 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
211 result = context.TryLink(jack_video_frame_offset_test, '.c')
212 context.Result(result)
217 # See if JACK supports jack_recompute_total_latency() (single port version)
220 jack_port_latency_test = """
221 #include <jack/jack.h>
222 int main(int argc, char **argv)
224 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
228 def CheckJackRecomputeLatency(context):
229 context.Message('Checking for jack_recompute_total_latency()...')
230 result = context.TryLink(jack_port_latency_test, '.c')
231 context.Result(result)
235 # See if JACK supports jack_port_ensure_monitor_input()
237 jack_ensure_monitor_input_test = """
238 #include <jack/jack.h>
239 int main(int argc, char** argv)
243 jack_port_ensure_monitor (*port, 1);
249 def CheckJackEnsureMonitorInput(context):
250 context.Message('Checking for jack_port_ensure_monitor_input()...')
251 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
252 context.Result(result)
255 conf = Configure(ardour, custom_tests = {
256 'CheckJackClientOpen' : CheckJackClientOpen,
257 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
258 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
259 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
260 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
263 if conf.CheckJackClientOpen():
264 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
266 if conf.CheckJackRecomputeLatencies():
267 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
269 if conf.CheckJackRecomputeLatency():
270 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
272 if conf.CheckJackVideoFrameOffset():
273 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
275 if conf.CheckJackEnsureMonitorInput():
276 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
278 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
281 # Optional header files
284 if conf.CheckCHeader('wordexp.h'):
285 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
287 if conf.CheckCHeader('sys/vfs.h'):
288 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
290 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
291 ardour.Append(LINKFLAGS="-framework CoreMIDI")
293 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
294 ardour.Append(LINKFLAGS="-framework AudioToolbox")
296 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
297 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
299 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
300 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
301 ardour.Append(LINKFLAGS="-framework AudioUnit")
302 extra_sources += audiounit_files
304 if ardour['COREAUDIO']:
305 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
306 extra_sources += coreaudio_files
308 if env['CONFIG_ARCH'] == 'apple':
309 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
310 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
312 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
314 ardour = conf.Finish ()
319 libraries['sndfile-ardour'],
322 libraries['samplerate'],
325 libraries['soundtouch'],
326 libraries['midi++2'],
332 ardour.Merge ([ libraries['lo'] ])
334 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
335 ardour.Merge ([ libraries['appleutility'] ])
337 def SharedAsmObjectEmitter(target, source, env):
339 tgt.attributes.shared = 1
340 return (target, source)
343 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
344 emitter = SharedAsmObjectEmitter,
345 suffix = '$SHOBJSUFFIX',
349 # handle objects that should always be compiled with -msse in their own
350 # special environment, which is exactly like "ardour" but unconditionally
355 always_sse_objects = []
356 sse_env = ardour.Copy()
357 sse_env.Append (CXXFLAGS="-msse")
359 if env['FPU_OPTIMIZATION']:
360 if env['DIST_TARGET'] == "i386":
361 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
362 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
363 if env['DIST_TARGET'] == "i686":
364 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
365 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
366 if env['DIST_TARGET'] == "x86_64":
367 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
368 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
370 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
375 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
378 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
380 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
382 env.Alias('tarball', env.Distribute (env['DISTTREE'],
383 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
384 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
385 glob.glob('po/*.po') + glob.glob('ardour/*.h')))