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("""
47 control_protocol_manager.cc
103 arch_specific_objects = [ ]
105 osc_files = [ 'osc.cc' ]
106 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
107 lv2_files = [ 'lv2_plugin.cc' ]
108 audiounit_files = [ 'audio_unit.cc' ]
109 coreaudio_files = [ 'coreaudiosource.cc' ]
114 extra_sources += vst_files
115 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
118 extra_sources += lv2_files
119 ardour.Append(CCFLAGS="-DHAVE_SLV2")
122 extra_sources += osc_files
124 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
125 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
126 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
127 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour2', 'vamp') + "\\\"")
128 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
129 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
131 ardour.Merge ([ libraries['jack'] ])
134 # See if JACK supports jack_client_open()
137 jack_test_source_file = """
138 #include <jack/jack.h>
139 int main(int argc, char **argv)
141 jack_client_open ("foo", 0, 0);
145 def CheckJackClientOpen(context):
146 context.Message('Checking for jack_client_open()...')
147 result = context.TryLink(jack_test_source_file, '.c')
148 context.Result(result)
152 # See if JACK supports jack_recompute_total_latencies()
155 jack_test_source_file = """
156 #include <jack/jack.h>
157 int main(int argc, char **argv)
159 jack_recompute_total_latencies ((jack_client_t*) 0);
163 def CheckJackRecomputeLatencies(context):
164 context.Message('Checking for jack_recompute_total_latencies()...')
165 result = context.TryLink(jack_test_source_file, '.c')
166 context.Result(result)
169 jack_video_frame_offset_test = """
170 #include <jack/transport.h>
171 int main(int argc, char** argv)
175 pos.valid & JackVideoFrameOffset;
179 def CheckJackVideoFrameOffset(context):
180 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
181 result = context.TryLink(jack_video_frame_offset_test, '.c')
182 context.Result(result)
186 # See if JACK supports jack_port_ensure_monitor_input()
188 jack_ensure_monitor_input_test = """
189 #include <jack/jack.h>
190 int main(int argc, char** argv)
194 jack_port_ensure_monitor (*port, 1);
200 def CheckJackEnsureMonitorInput(context):
201 context.Message('Checking for jack_port_ensure_monitor_input()...')
202 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
203 context.Result(result)
206 conf = Configure(ardour, custom_tests = {
207 'CheckJackClientOpen' : CheckJackClientOpen,
208 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
209 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
210 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
213 if conf.CheckJackClientOpen():
214 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
216 if conf.CheckJackRecomputeLatencies():
217 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
219 if conf.CheckJackVideoFrameOffset():
220 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
222 if conf.CheckJackEnsureMonitorInput():
223 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
225 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
228 # Optional header files
231 if conf.CheckCHeader('wordexp.h'):
232 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
234 if conf.CheckCHeader('sys/vfs.h'):
235 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
237 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
238 ardour.Append(LINKFLAGS="-framework CoreMIDI")
240 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
241 ardour.Append(LINKFLAGS="-framework AudioToolbox")
243 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
244 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
246 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
247 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
248 ardour.Append(LINKFLAGS="-framework AudioUnit")
249 extra_sources += audiounit_files
251 if ardour['COREAUDIO']:
252 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
253 extra_sources += coreaudio_files
255 if env['CONFIG_ARCH'] == 'apple':
256 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
258 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
260 ardour = conf.Finish ()
265 libraries['sndfile-ardour'],
268 libraries['samplerate'],
271 libraries['midi++2'],
273 libraries['glibmm2'],
275 libraries['vamphost'],
280 if ardour['RUBBERBAND']:
281 ardour.Merge ([ libraries['rubberband']])
282 timefx_sources += [ 'rb_effect.cc' ]
284 ardour.Merge ([ libraries['soundtouch'] ])
285 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
288 ardour.Merge ([ libraries['slv2'] ])
291 ardour.Merge ([ libraries['lo'] ])
293 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
294 ardour.Merge ([ libraries['appleutility'] ])
296 def SharedAsmObjectEmitter(target, source, env):
298 tgt.attributes.shared = 1
299 return (target, source)
302 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
303 emitter = SharedAsmObjectEmitter,
304 suffix = '$SHOBJSUFFIX',
308 # handle objects that should always be compiled with -msse in their own
309 # special environment, which is exactly like "ardour" but unconditionally
314 always_sse_objects = []
315 sse_env = ardour.Copy()
316 sse_env.Append (CXXFLAGS="-msse")
318 if env['FPU_OPTIMIZATION']:
319 if env['DIST_TARGET'] == "i386":
320 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
321 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
322 if env['DIST_TARGET'] == "i686":
323 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
324 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
325 if env['DIST_TARGET'] == "x86_64":
326 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
327 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
329 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
334 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
337 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
339 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
341 env.Alias('tarball', env.Distribute (env['DISTTREE'],
342 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
343 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
344 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
345 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
346 glob.glob('po/*.po') + glob.glob('ardour/*.h')))