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("""
34 filename_extensions.cc
72 control_protocol_manager.cc
73 control_protocol_search_path.cc
119 session_state_utils.cc
135 arch_specific_objects = [ ]
137 osc_files = [ 'osc.cc' ]
138 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
139 audiounit_files = [ 'audio_unit.cc' ]
140 coreaudio_files = [ 'coreaudiosource.cc' ]
144 extra_sources += vst_files
145 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
148 extra_sources += osc_files
150 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
151 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
152 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
153 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
154 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
156 ardour.Merge ([ libraries['jack'] ])
159 # See if JACK supports jack_client_open()
162 jack_test_source_file = """
163 #include <jack/jack.h>
164 int main(int argc, char **argv)
166 jack_client_open ("foo", 0, 0);
170 def CheckJackClientOpen(context):
171 context.Message('Checking for jack_client_open()...')
172 result = context.TryLink(jack_test_source_file, '.c')
173 context.Result(result)
177 # See if JACK supports jack_recompute_total_latencies()
180 jack_test_source_file = """
181 #include <jack/jack.h>
182 int main(int argc, char **argv)
184 jack_recompute_total_latencies ((jack_client_t*) 0);
188 def CheckJackRecomputeLatencies(context):
189 context.Message('Checking for jack_recompute_total_latencies()...')
190 result = context.TryLink(jack_test_source_file, '.c')
191 context.Result(result)
194 jack_video_frame_offset_test = """
195 #include <jack/transport.h>
196 int main(int argc, char** argv)
200 pos.valid & JackVideoFrameOffset;
204 def CheckJackVideoFrameOffset(context):
205 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
206 result = context.TryLink(jack_video_frame_offset_test, '.c')
207 context.Result(result)
212 # See if JACK supports jack_recompute_total_latency() (single port version)
215 jack_port_latency_test = """
216 #include <jack/jack.h>
217 int main(int argc, char **argv)
219 jack_recompute_total_latency ((jack_client_t*) 0, (jack_port_t*) 0);
223 def CheckJackRecomputeLatency(context):
224 context.Message('Checking for jack_recompute_total_latency()...')
225 result = context.TryLink(jack_port_latency_test, '.c')
226 context.Result(result)
230 # See if JACK supports jack_port_ensure_monitor_input()
232 jack_ensure_monitor_input_test = """
233 #include <jack/jack.h>
234 int main(int argc, char** argv)
238 jack_port_ensure_monitor (*port, 1);
244 def CheckJackEnsureMonitorInput(context):
245 context.Message('Checking for jack_port_ensure_monitor_input()...')
246 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
247 context.Result(result)
250 conf = Configure(ardour, custom_tests = {
251 'CheckJackClientOpen' : CheckJackClientOpen,
252 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
253 'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
254 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
255 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
258 if conf.CheckJackClientOpen():
259 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
261 if conf.CheckJackRecomputeLatencies():
262 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
264 if conf.CheckJackRecomputeLatency():
265 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCY")
267 if conf.CheckJackVideoFrameOffset():
268 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
270 if conf.CheckJackEnsureMonitorInput():
271 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
273 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
276 # Optional header files
279 if conf.CheckCHeader('wordexp.h'):
280 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
282 if conf.CheckCHeader('sys/vfs.h'):
283 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
285 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
286 ardour.Append(LINKFLAGS="-framework CoreMIDI")
288 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
289 ardour.Append(LINKFLAGS="-framework AudioToolbox")
291 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
292 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
294 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
295 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
296 ardour.Append(LINKFLAGS="-framework AudioUnit")
297 extra_sources += audiounit_files
299 if ardour['COREAUDIO']:
300 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
301 extra_sources += coreaudio_files
303 if env['CONFIG_ARCH'] == 'apple':
304 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
305 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
307 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
309 ardour = conf.Finish ()
314 libraries['sndfile-ardour'],
317 libraries['samplerate'],
320 libraries['soundtouch'],
321 libraries['midi++2'],
327 ardour.Merge ([ libraries['lo'] ])
329 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
330 ardour.Merge ([ libraries['appleutility'] ])
332 def SharedAsmObjectEmitter(target, source, env):
334 tgt.attributes.shared = 1
335 return (target, source)
338 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
339 emitter = SharedAsmObjectEmitter,
340 suffix = '$SHOBJSUFFIX',
344 # handle objects that should always be compiled with -msse in their own
345 # special environment, which is exactly like "ardour" but unconditionally
350 always_sse_objects = []
351 sse_env = ardour.Copy()
352 sse_env.Append (CXXFLAGS="-msse")
354 if env['FPU_OPTIMIZATION']:
355 if env['DIST_TARGET'] == "i386":
356 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
357 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
358 if env['DIST_TARGET'] == "i686":
359 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
360 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
361 if env['DIST_TARGET'] == "x86_64":
362 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
363 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
365 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
370 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
373 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
375 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
377 env.Alias('tarball', env.Distribute (env['DISTTREE'],
378 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
379 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
380 glob.glob('po/*.po') + glob.glob('ardour/*.h')))