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
106 transient_detector.cc
111 arch_specific_objects = [ ]
113 osc_files = [ 'osc.cc' ]
114 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
115 lv2_files = [ 'lv2_plugin.cc' ]
116 audiounit_files = [ 'audio_unit.cc' ]
117 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
122 extra_sources += vst_files
123 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
126 extra_sources += lv2_files
127 ardour.Append(CCFLAGS="-DHAVE_SLV2")
130 extra_sources += osc_files
132 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
133 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
134 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
135 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour2', 'vamp') + "\\\"")
136 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
137 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
139 ardour.Merge ([ libraries['jack'] ])
142 # See if JACK supports jack_client_open()
145 jack_test_source_file = """
146 #include <jack/jack.h>
147 int main(int argc, char **argv)
149 jack_client_open ("foo", 0, 0);
153 def CheckJackClientOpen(context):
154 context.Message('Checking for jack_client_open()...')
155 result = context.TryLink(jack_test_source_file, '.c')
156 context.Result(result)
160 # See if JACK supports jack_recompute_total_latencies()
163 jack_test_source_file = """
164 #include <jack/jack.h>
165 int main(int argc, char **argv)
167 jack_recompute_total_latencies ((jack_client_t*) 0);
171 def CheckJackRecomputeLatencies(context):
172 context.Message('Checking for jack_recompute_total_latencies()...')
173 result = context.TryLink(jack_test_source_file, '.c')
174 context.Result(result)
177 jack_video_frame_offset_test = """
178 #include <jack/transport.h>
179 int main(int argc, char** argv)
183 pos.valid & JackVideoFrameOffset;
187 def CheckJackVideoFrameOffset(context):
188 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
189 result = context.TryLink(jack_video_frame_offset_test, '.c')
190 context.Result(result)
194 # See if JACK supports jack_port_ensure_monitor_input()
196 jack_ensure_monitor_input_test = """
197 #include <jack/jack.h>
198 int main(int argc, char** argv)
202 jack_port_ensure_monitor (*port, 1);
208 def CheckJackEnsureMonitorInput(context):
209 context.Message('Checking for jack_port_ensure_monitor_input()...')
210 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
211 context.Result(result)
214 conf = Configure(ardour, custom_tests = {
215 'CheckJackClientOpen' : CheckJackClientOpen,
216 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
217 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
218 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
221 if conf.CheckJackClientOpen():
222 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
224 if conf.CheckJackRecomputeLatencies():
225 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
227 if conf.CheckJackVideoFrameOffset():
228 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
230 if conf.CheckJackEnsureMonitorInput():
231 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
233 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
236 # Optional header files
239 if conf.CheckCHeader('wordexp.h'):
240 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
242 if conf.CheckCHeader('sys/vfs.h'):
243 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
245 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
246 ardour.Append(LINKFLAGS="-framework CoreMIDI")
248 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
249 ardour.Append(LINKFLAGS="-framework AudioToolbox")
251 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
252 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
254 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
255 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
256 ardour.Append(LINKFLAGS="-framework AudioUnit")
257 if ardour['AUSTATE']:
258 ardour.Append(CXXFLAGS="-DAU_STATE_SUPPORT")
259 extra_sources += audiounit_files
261 if ardour['COREAUDIO']:
262 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
263 extra_sources += coreaudio_files
265 if env['CONFIG_ARCH'] == 'apple':
266 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
268 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
270 ardour = conf.Finish ()
277 libraries['glibmm2'],
279 libraries['midi++2'],
282 libraries['samplerate'],
284 libraries['sndfile'],
286 libraries['vamphost'],
290 if ardour['RUBBERBAND']:
291 ardour.Merge ([ libraries['rubberband']])
292 timefx_sources += [ 'rb_effect.cc' ]
294 ardour.Merge ([ libraries['soundtouch'] ])
295 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
298 ardour.Merge ([ libraries['slv2'] ])
301 ardour.Merge ([ libraries['lo'] ])
303 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
304 ardour.Merge ([ libraries['appleutility'] ])
306 def SharedAsmObjectEmitter(target, source, env):
308 tgt.attributes.shared = 1
309 return (target, source)
312 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
313 emitter = SharedAsmObjectEmitter,
314 suffix = '$SHOBJSUFFIX',
318 # handle objects that should always be compiled with -msse in their own
319 # special environment, which is exactly like "ardour" but unconditionally
324 always_sse_objects = []
325 sse_env = ardour.Clone()
326 sse_env.Append (CXXFLAGS="-msse")
328 if env['FPU_OPTIMIZATION']:
329 if env['DIST_TARGET'] == "i386":
330 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
331 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
332 if env['DIST_TARGET'] == "i686":
333 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
334 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
335 if env['DIST_TARGET'] == "x86_64":
336 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
337 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
339 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
344 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
347 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
349 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
351 env.Alias('tarball', env.Distribute (env['DISTTREE'],
352 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
353 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
354 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
361 glob.glob('po/*.po') + glob.glob('ardour/*.h')))