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 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("""
49 control_protocol_manager.cc
104 transient_detector.cc
109 arch_specific_objects = [ ]
111 osc_files = [ 'osc.cc' ]
112 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
113 lv2_files = [ 'lv2_plugin.cc' ]
114 audiounit_files = [ 'audio_unit.cc' ]
115 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
120 extra_sources += vst_files
121 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
124 extra_sources += lv2_files
125 ardour.Append(CCFLAGS="-DHAVE_SLV2")
128 extra_sources += osc_files
130 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
131 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
132 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
133 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour2', 'vamp') + "\\\"")
134 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
135 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
137 ardour.Merge ([ libraries['jack'] ])
140 # See if JACK supports jack_client_open()
143 jack_test_source_file = """
144 #include <jack/jack.h>
145 int main(int argc, char **argv)
147 jack_client_open ("foo", 0, 0);
151 def CheckJackClientOpen(context):
152 context.Message('Checking for jack_client_open()...')
153 result = context.TryLink(jack_test_source_file, '.c')
154 context.Result(result)
158 # See if JACK supports jack_recompute_total_latencies()
161 jack_test_source_file = """
162 #include <jack/jack.h>
163 int main(int argc, char **argv)
165 jack_recompute_total_latencies ((jack_client_t*) 0);
169 def CheckJackRecomputeLatencies(context):
170 context.Message('Checking for jack_recompute_total_latencies()...')
171 result = context.TryLink(jack_test_source_file, '.c')
172 context.Result(result)
175 jack_video_frame_offset_test = """
176 #include <jack/transport.h>
177 int main(int argc, char** argv)
181 pos.valid & JackVideoFrameOffset;
185 def CheckJackVideoFrameOffset(context):
186 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
187 result = context.TryLink(jack_video_frame_offset_test, '.c')
188 context.Result(result)
192 # See if JACK supports jack_port_ensure_monitor_input()
194 jack_ensure_monitor_input_test = """
195 #include <jack/jack.h>
196 int main(int argc, char** argv)
200 jack_port_ensure_monitor (*port, 1);
206 def CheckJackEnsureMonitorInput(context):
207 context.Message('Checking for jack_port_ensure_monitor_input()...')
208 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
209 context.Result(result)
212 conf = Configure(ardour, custom_tests = {
213 'CheckJackClientOpen' : CheckJackClientOpen,
214 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
215 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
216 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
219 if conf.CheckJackClientOpen():
220 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
222 if conf.CheckJackRecomputeLatencies():
223 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
225 if conf.CheckJackVideoFrameOffset():
226 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
228 if conf.CheckJackEnsureMonitorInput():
229 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
231 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
234 # Optional header files
237 if conf.CheckCHeader('wordexp.h'):
238 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
240 if conf.CheckCHeader('sys/vfs.h'):
241 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
243 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
244 ardour.Append(LINKFLAGS="-framework CoreMIDI")
246 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
247 ardour.Append(LINKFLAGS="-framework AudioToolbox")
249 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
250 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
252 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
253 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
254 ardour.Append(LINKFLAGS="-framework AudioUnit")
255 extra_sources += audiounit_files
257 if ardour['COREAUDIO']:
258 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
259 extra_sources += coreaudio_files
261 if env['CONFIG_ARCH'] == 'apple':
262 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
264 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
266 ardour = conf.Finish ()
273 libraries['glibmm2'],
275 libraries['midi++2'],
278 libraries['samplerate'],
280 libraries['sndfile-ardour'],
282 libraries['vamphost'],
286 if ardour['RUBBERBAND']:
287 ardour.Merge ([ libraries['rubberband']])
288 timefx_sources += [ 'rb_effect.cc' ]
290 ardour.Merge ([ libraries['soundtouch'] ])
291 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
294 ardour.Merge ([ libraries['slv2'] ])
297 ardour.Merge ([ libraries['lo'] ])
299 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
300 ardour.Merge ([ libraries['appleutility'] ])
302 def SharedAsmObjectEmitter(target, source, env):
304 tgt.attributes.shared = 1
305 return (target, source)
308 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
309 emitter = SharedAsmObjectEmitter,
310 suffix = '$SHOBJSUFFIX',
314 # handle objects that should always be compiled with -msse in their own
315 # special environment, which is exactly like "ardour" but unconditionally
320 always_sse_objects = []
321 sse_env = ardour.Clone()
322 sse_env.Append (CXXFLAGS="-msse")
324 if env['FPU_OPTIMIZATION']:
325 if env['DIST_TARGET'] == "i386":
326 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
327 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
328 if env['DIST_TARGET'] == "i686":
329 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
330 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
331 if env['DIST_TARGET'] == "x86_64":
332 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
333 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
335 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
340 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
343 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
345 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
347 env.Alias('tarball', env.Distribute (env['DISTTREE'],
348 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
349 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
350 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
357 glob.glob('po/*.po') + glob.glob('ardour/*.h')))