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 lv2_files = [ 'lv2_plugin.cc' ]
107 audiounit_files = [ 'audio_unit.cc' ]
108 coreaudio_files = [ 'coreaudiosource.cc' ]
113 extra_sources += vst_files
114 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
117 extra_sources += lv2_files
118 ardour.Append(CCFLAGS="-DHAVE_SLV2")
121 extra_sources += osc_files
123 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
124 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
125 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
126 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
127 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
129 ardour.Merge ([ libraries['jack'] ])
132 # See if JACK supports jack_client_open()
135 jack_test_source_file = """
136 #include <jack/jack.h>
137 int main(int argc, char **argv)
139 jack_client_open ("foo", 0, 0);
143 def CheckJackClientOpen(context):
144 context.Message('Checking for jack_client_open()...')
145 result = context.TryLink(jack_test_source_file, '.c')
146 context.Result(result)
150 # See if JACK supports jack_recompute_total_latencies()
153 jack_test_source_file = """
154 #include <jack/jack.h>
155 int main(int argc, char **argv)
157 jack_recompute_total_latencies ((jack_client_t*) 0);
161 def CheckJackRecomputeLatencies(context):
162 context.Message('Checking for jack_recompute_total_latencies()...')
163 result = context.TryLink(jack_test_source_file, '.c')
164 context.Result(result)
167 jack_video_frame_offset_test = """
168 #include <jack/transport.h>
169 int main(int argc, char** argv)
173 pos.valid & JackVideoFrameOffset;
177 def CheckJackVideoFrameOffset(context):
178 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
179 result = context.TryLink(jack_video_frame_offset_test, '.c')
180 context.Result(result)
184 # See if JACK supports jack_port_ensure_monitor_input()
186 jack_ensure_monitor_input_test = """
187 #include <jack/jack.h>
188 int main(int argc, char** argv)
192 jack_port_ensure_monitor (*port, 1);
198 def CheckJackEnsureMonitorInput(context):
199 context.Message('Checking for jack_port_ensure_monitor_input()...')
200 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
201 context.Result(result)
204 conf = Configure(ardour, custom_tests = {
205 'CheckJackClientOpen' : CheckJackClientOpen,
206 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
207 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
208 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
211 if conf.CheckJackClientOpen():
212 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
214 if conf.CheckJackRecomputeLatencies():
215 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
217 if conf.CheckJackVideoFrameOffset():
218 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
220 if conf.CheckJackEnsureMonitorInput():
221 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
223 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
226 # Optional header files
229 if conf.CheckCHeader('wordexp.h'):
230 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
232 if conf.CheckCHeader('sys/vfs.h'):
233 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
235 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
236 ardour.Append(LINKFLAGS="-framework CoreMIDI")
238 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
239 ardour.Append(LINKFLAGS="-framework AudioToolbox")
241 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
242 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
244 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
245 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
246 ardour.Append(LINKFLAGS="-framework AudioUnit")
247 extra_sources += audiounit_files
249 if ardour['COREAUDIO']:
250 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
251 extra_sources += coreaudio_files
253 if env['CONFIG_ARCH'] == 'apple':
254 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
256 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
258 ardour = conf.Finish ()
263 libraries['sndfile-ardour'],
266 libraries['samplerate'],
269 libraries['midi++2'],
271 libraries['glibmm2'],
273 libraries['vamphost'],
278 if ardour['RUBBERBAND']:
279 ardour.Merge ([ libraries['rubberband']])
280 timefx_sources += [ 'rb_effect.cc' ]
282 ardour.Merge ([ libraries['soundtouch'] ])
283 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
286 ardour.Merge ([ libraries['slv2'] ])
289 ardour.Merge ([ libraries['lo'] ])
291 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
292 ardour.Merge ([ libraries['appleutility'] ])
294 def SharedAsmObjectEmitter(target, source, env):
296 tgt.attributes.shared = 1
297 return (target, source)
300 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
301 emitter = SharedAsmObjectEmitter,
302 suffix = '$SHOBJSUFFIX',
306 # handle objects that should always be compiled with -msse in their own
307 # special environment, which is exactly like "ardour" but unconditionally
312 always_sse_objects = []
313 sse_env = ardour.Copy()
314 sse_env.Append (CXXFLAGS="-msse")
316 if env['FPU_OPTIMIZATION']:
317 if env['DIST_TARGET'] == "i386":
318 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
319 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
320 if env['DIST_TARGET'] == "i686":
321 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
322 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
323 if env['DIST_TARGET'] == "x86_64":
324 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
325 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
327 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
332 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
335 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
337 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
339 env.Alias('tarball', env.Distribute (env['DISTTREE'],
340 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
341 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
342 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
343 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
344 glob.glob('po/*.po') + glob.glob('ardour/*.h')))