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")
28 # explicitly reference the control protocol LGPL library for includes
31 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
33 ardour_files=Split("""
50 control_protocol_manager.cc
107 transient_detector.cc
112 arch_specific_objects = [ ]
114 osc_files = [ 'osc.cc' ]
115 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
116 lv2_files = [ 'lv2_plugin.cc' ]
117 audiounit_files = [ 'audio_unit.cc' ]
118 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
123 extra_sources += vst_files
124 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
127 extra_sources += lv2_files
128 ardour.Append(CCFLAGS="-DHAVE_SLV2")
131 extra_sources += osc_files
133 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
134 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
135 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
136 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour2', 'vamp') + "\\\"")
137 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
138 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
140 ardour.Merge ([ libraries['jack'] ])
143 # See if JACK supports jack_client_open()
146 jack_test_source_file = """
147 #include <jack/jack.h>
148 int main(int argc, char **argv)
150 jack_client_open ("foo", 0, 0);
154 def CheckJackClientOpen(context):
155 context.Message('Checking for jack_client_open()...')
156 result = context.TryLink(jack_test_source_file, '.c')
157 context.Result(result)
161 # See if JACK supports jack_recompute_total_latencies()
164 jack_test_source_file = """
165 #include <jack/jack.h>
166 int main(int argc, char **argv)
168 jack_recompute_total_latencies ((jack_client_t*) 0);
172 def CheckJackRecomputeLatencies(context):
173 context.Message('Checking for jack_recompute_total_latencies()...')
174 result = context.TryLink(jack_test_source_file, '.c')
175 context.Result(result)
178 jack_video_frame_offset_test = """
179 #include <jack/transport.h>
180 int main(int argc, char** argv)
184 pos.valid & JackVideoFrameOffset;
188 def CheckJackVideoFrameOffset(context):
189 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
190 result = context.TryLink(jack_video_frame_offset_test, '.c')
191 context.Result(result)
195 # See if JACK supports jack_port_ensure_monitor_input()
197 jack_ensure_monitor_input_test = """
198 #include <jack/jack.h>
199 int main(int argc, char** argv)
203 jack_port_ensure_monitor (*port, 1);
209 def CheckJackEnsureMonitorInput(context):
210 context.Message('Checking for jack_port_ensure_monitor_input()...')
211 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
212 context.Result(result)
215 conf = Configure(ardour, custom_tests = {
216 'CheckJackClientOpen' : CheckJackClientOpen,
217 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
218 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
219 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
222 if conf.CheckJackClientOpen():
223 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
225 if conf.CheckJackRecomputeLatencies():
226 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
228 if conf.CheckJackVideoFrameOffset():
229 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
231 if conf.CheckJackEnsureMonitorInput():
232 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
234 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
237 # Optional header files
240 if conf.CheckCHeader('wordexp.h'):
241 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
243 if conf.CheckCHeader('sys/vfs.h'):
244 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
246 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
247 ardour.Append(LINKFLAGS="-framework CoreMIDI")
249 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
250 ardour.Append(LINKFLAGS="-framework AudioToolbox")
252 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
253 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
255 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
256 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
257 ardour.Append(LINKFLAGS="-framework AudioUnit")
258 if ardour['AUSTATE']:
259 ardour.Append(CXXFLAGS="-DAU_STATE_SUPPORT")
260 extra_sources += audiounit_files
262 if ardour['COREAUDIO']:
263 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
264 extra_sources += coreaudio_files
266 if env['CONFIG_ARCH'] == 'apple':
267 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
269 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
271 ardour = conf.Finish ()
278 libraries['glibmm2'],
280 libraries['midi++2'],
283 libraries['samplerate'],
285 libraries['sndfile'],
287 libraries['vamphost'],
291 if ardour['RUBBERBAND']:
292 ardour.Merge ([ libraries['rubberband']])
293 timefx_sources += [ 'rb_effect.cc' ]
295 ardour.Merge ([ libraries['soundtouch'] ])
296 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
299 ardour.Merge ([ libraries['slv2'] ])
302 ardour.Merge ([ libraries['lo'] ])
304 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
305 ardour.Merge ([ libraries['appleutility'] ])
307 def SharedAsmObjectEmitter(target, source, env):
309 tgt.attributes.shared = 1
310 return (target, source)
313 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
314 emitter = SharedAsmObjectEmitter,
315 suffix = '$SHOBJSUFFIX',
319 # handle objects that should always be compiled with -msse in their own
320 # special environment, which is exactly like "ardour" but unconditionally
325 always_sse_objects = []
326 sse_env = ardour.Clone()
327 sse_env.Append (CXXFLAGS="-msse")
329 if env['FPU_OPTIMIZATION']:
330 print "FPU OPTIMIZATION WITH TARGET "; print env['DIST_TARGET'];
331 if env['DIST_TARGET'] == "i386":
332 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
333 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
334 if env['DIST_TARGET'] == "i686":
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'] == "x86_64":
338 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
339 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
341 print "No FPU OPTIMIZATION here!!!\n"
343 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
348 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
351 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
353 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
355 env.Alias('tarball', env.Distribute (env['DISTTREE'],
356 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
357 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
358 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
365 glob.glob('po/*.po') + glob.glob('ardour/*.h')))