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("""
46 control_protocol_manager.cc
102 arch_specific_objects = [ ]
104 osc_files = [ 'osc.cc' ]
105 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
106 audiounit_files = [ 'audio_unit.cc' ]
107 coreaudio_files = [ 'coreaudiosource.cc' ]
111 extra_sources += vst_files
112 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
115 extra_sources += osc_files
117 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
118 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
119 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
120 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
121 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
123 ardour.Merge ([ libraries['jack'] ])
126 # See if JACK supports jack_client_open()
129 jack_test_source_file = """
130 #include <jack/jack.h>
131 int main(int argc, char **argv)
133 jack_client_open ("foo", 0, 0);
137 def CheckJackClientOpen(context):
138 context.Message('Checking for jack_client_open()...')
139 result = context.TryLink(jack_test_source_file, '.c')
140 context.Result(result)
144 # See if JACK supports jack_recompute_total_latencies()
147 jack_test_source_file = """
148 #include <jack/jack.h>
149 int main(int argc, char **argv)
151 jack_recompute_total_latencies ((jack_client_t*) 0);
155 def CheckJackRecomputeLatencies(context):
156 context.Message('Checking for jack_recompute_total_latencies()...')
157 result = context.TryLink(jack_test_source_file, '.c')
158 context.Result(result)
161 jack_video_frame_offset_test = """
162 #include <jack/transport.h>
163 int main(int argc, char** argv)
167 pos.valid & JackVideoFrameOffset;
171 def CheckJackVideoFrameOffset(context):
172 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
173 result = context.TryLink(jack_video_frame_offset_test, '.c')
174 context.Result(result)
178 # See if JACK supports jack_port_ensure_monitor_input()
180 jack_ensure_monitor_input_test = """
181 #include <jack/jack.h>
182 int main(int argc, char** argv)
186 jack_port_ensure_monitor (*port, 1);
192 def CheckJackEnsureMonitorInput(context):
193 context.Message('Checking for jack_port_ensure_monitor_input()...')
194 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
195 context.Result(result)
198 conf = Configure(ardour, custom_tests = {
199 'CheckJackClientOpen' : CheckJackClientOpen,
200 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
201 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
202 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
205 if conf.CheckJackClientOpen():
206 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
208 if conf.CheckJackRecomputeLatencies():
209 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
211 if conf.CheckJackVideoFrameOffset():
212 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
214 if conf.CheckJackEnsureMonitorInput():
215 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
217 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
220 # Optional header files
223 if conf.CheckCHeader('wordexp.h'):
224 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
226 if conf.CheckCHeader('sys/vfs.h'):
227 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
229 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
230 ardour.Append(LINKFLAGS="-framework CoreMIDI")
232 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
233 ardour.Append(LINKFLAGS="-framework AudioToolbox")
235 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
236 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
238 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
239 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
240 ardour.Append(LINKFLAGS="-framework AudioUnit")
241 extra_sources += audiounit_files
243 if ardour['COREAUDIO']:
244 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
245 extra_sources += coreaudio_files
247 if env['CONFIG_ARCH'] == 'apple':
248 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
250 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
252 ardour = conf.Finish ()
257 libraries['sndfile-ardour'],
260 libraries['samplerate'],
263 libraries['soundtouch'],
264 libraries['midi++2'],
270 ardour.Merge ([ libraries['lo'] ])
272 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
273 ardour.Merge ([ libraries['appleutility'] ])
275 def SharedAsmObjectEmitter(target, source, env):
277 tgt.attributes.shared = 1
278 return (target, source)
281 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
282 emitter = SharedAsmObjectEmitter,
283 suffix = '$SHOBJSUFFIX',
287 # handle objects that should always be compiled with -msse in their own
288 # special environment, which is exactly like "ardour" but unconditionally
293 always_sse_objects = []
294 sse_env = ardour.Copy()
295 sse_env.Append (CXXFLAGS="-msse")
297 if env['FPU_OPTIMIZATION']:
298 if env['DIST_TARGET'] == "i386":
299 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
300 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
301 if env['DIST_TARGET'] == "i686":
302 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
303 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
304 if env['DIST_TARGET'] == "x86_64":
305 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
306 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
308 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
313 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
316 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
318 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
320 env.Alias('tarball', env.Distribute (env['DISTTREE'],
321 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
322 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
323 glob.glob('po/*.po') + glob.glob('ardour/*.h')))