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 # explicitly reference the control protocol LGPL library for includes
27 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
29 ardour_files=Split("""
54 control_protocol_manager.cc
55 control_protocol_search_path.cc
63 filename_extensions.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)
235 conf = Configure(ardour, custom_tests = {
236 'CheckJackClientOpen' : CheckJackClientOpen,
237 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
238 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
239 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
242 if conf.CheckJackClientOpen():
243 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
245 if conf.CheckJackRecomputeLatencies():
246 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
248 if conf.CheckJackRecomputeLatency():
249 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
251 if conf.CheckJackVideoFrameOffset():
252 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
255 # Optional header files
258 if conf.CheckCHeader('wordexp.h'):
259 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
261 if conf.CheckCHeader('sys/vfs.h'):
262 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
264 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
265 ardour.Append(LINKFLAGS="-framework CoreMIDI")
267 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
268 ardour.Append(LINKFLAGS="-framework AudioToolbox")
270 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
271 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
273 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
274 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
275 ardour.Append(LINKFLAGS="-framework AudioUnit")
276 extra_sources += audiounit_files
278 if ardour['COREAUDIO']:
279 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
280 extra_sources += coreaudio_files
282 if env['CONFIG_ARCH'] == 'apple':
283 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
284 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
286 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
288 ardour = conf.Finish ()
293 libraries['sndfile-ardour'],
296 libraries['samplerate'],
299 libraries['soundtouch'],
300 libraries['midi++2'],
306 ardour.Merge ([ libraries['lo'] ])
308 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
309 ardour.Merge ([ libraries['appleutility'] ])
311 def SharedAsmObjectEmitter(target, source, env):
313 tgt.attributes.shared = 1
314 return (target, source)
317 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
318 emitter = SharedAsmObjectEmitter,
319 suffix = '$SHOBJSUFFIX',
323 # handle objects that should always be compiled with -msse in their own
324 # special environment, which is exactly like "ardour" but unconditionally
329 always_sse_objects = []
330 sse_env = ardour.Copy()
331 sse_env.Append (CXXFLAGS="-msse")
333 if env['FPU_OPTIMIZATION']:
334 if env['DIST_TARGET'] == "i386":
335 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
336 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
337 if env['DIST_TARGET'] == "i686":
338 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
339 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
340 if env['DIST_TARGET'] == "x86_64":
341 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
342 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
344 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
349 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
352 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
354 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
356 env.Alias('tarball', env.Distribute (env['DISTTREE'],
357 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
358 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
359 glob.glob('po/*.po') + glob.glob('ardour/*.h')))