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")
27 # explicitly reference the control protocol LGPL library for includes
30 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
32 ardour_files=Split("""
49 control_protocol_manager.cc
105 transient_detector.cc
110 arch_specific_objects = [ ]
112 osc_files = [ 'osc.cc' ]
113 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
114 lv2_files = [ 'lv2_plugin.cc' ]
115 audiounit_files = [ 'audio_unit.cc' ]
116 coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
121 extra_sources += vst_files
122 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
125 extra_sources += lv2_files
126 ardour.Append(CCFLAGS="-DHAVE_SLV2")
129 extra_sources += osc_files
131 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
132 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
133 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
134 ardour.Append(CXXFLAGS="-DVAMP_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR'], 'ardour2', 'vamp') + "\\\"")
135 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
136 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
138 ardour.Merge ([ libraries['jack'] ])
141 # See if JACK supports jack_client_open()
144 jack_test_source_file = """
145 #include <jack/jack.h>
146 int main(int argc, char **argv)
148 jack_client_open ("foo", 0, 0);
152 def CheckJackClientOpen(context):
153 context.Message('Checking for jack_client_open()...')
154 result = context.TryLink(jack_test_source_file, '.c')
155 context.Result(result)
159 # See if JACK supports jack_recompute_total_latencies()
162 jack_test_source_file = """
163 #include <jack/jack.h>
164 int main(int argc, char **argv)
166 jack_recompute_total_latencies ((jack_client_t*) 0);
170 def CheckJackRecomputeLatencies(context):
171 context.Message('Checking for jack_recompute_total_latencies()...')
172 result = context.TryLink(jack_test_source_file, '.c')
173 context.Result(result)
176 jack_video_frame_offset_test = """
177 #include <jack/transport.h>
178 int main(int argc, char** argv)
182 pos.valid & JackVideoFrameOffset;
186 def CheckJackVideoFrameOffset(context):
187 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
188 result = context.TryLink(jack_video_frame_offset_test, '.c')
189 context.Result(result)
193 # See if JACK supports jack_port_ensure_monitor_input()
195 jack_ensure_monitor_input_test = """
196 #include <jack/jack.h>
197 int main(int argc, char** argv)
201 jack_port_ensure_monitor (*port, 1);
207 def CheckJackEnsureMonitorInput(context):
208 context.Message('Checking for jack_port_ensure_monitor_input()...')
209 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
210 context.Result(result)
213 conf = Configure(ardour, custom_tests = {
214 'CheckJackClientOpen' : CheckJackClientOpen,
215 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
216 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
217 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
220 if conf.CheckJackClientOpen():
221 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
223 if conf.CheckJackRecomputeLatencies():
224 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
226 if conf.CheckJackVideoFrameOffset():
227 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
229 if conf.CheckJackEnsureMonitorInput():
230 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
232 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
235 # Optional header files
238 if conf.CheckCHeader('wordexp.h'):
239 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
241 if conf.CheckCHeader('sys/vfs.h'):
242 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
244 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
245 ardour.Append(LINKFLAGS="-framework CoreMIDI")
247 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
248 ardour.Append(LINKFLAGS="-framework AudioToolbox")
250 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
251 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
253 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
254 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
255 ardour.Append(LINKFLAGS="-framework AudioUnit")
256 extra_sources += audiounit_files
258 if ardour['COREAUDIO']:
259 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
260 extra_sources += coreaudio_files
262 if env['CONFIG_ARCH'] == 'apple':
263 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
265 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
267 ardour = conf.Finish ()
274 libraries['glibmm2'],
276 libraries['midi++2'],
279 libraries['samplerate'],
281 libraries['sndfile-ardour'],
283 libraries['vamphost'],
287 if ardour['RUBBERBAND']:
288 ardour.Merge ([ libraries['rubberband']])
289 timefx_sources += [ 'rb_effect.cc' ]
291 ardour.Merge ([ libraries['soundtouch'] ])
292 timefx_sources += [ 'st_stretch.cc', 'st_pitch.cc' ]
295 ardour.Merge ([ libraries['slv2'] ])
298 ardour.Merge ([ libraries['lo'] ])
300 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
301 ardour.Merge ([ libraries['appleutility'] ])
303 def SharedAsmObjectEmitter(target, source, env):
305 tgt.attributes.shared = 1
306 return (target, source)
309 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
310 emitter = SharedAsmObjectEmitter,
311 suffix = '$SHOBJSUFFIX',
315 # handle objects that should always be compiled with -msse in their own
316 # special environment, which is exactly like "ardour" but unconditionally
321 always_sse_objects = []
322 sse_env = ardour.Clone()
323 sse_env.Append (CXXFLAGS="-msse")
325 if env['FPU_OPTIMIZATION']:
326 if env['DIST_TARGET'] == "i386":
327 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
328 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
329 if env['DIST_TARGET'] == "i686":
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'] == "x86_64":
333 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
334 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
336 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + timefx_sources + extra_sources + arch_specific_objects)
341 i18n (ardour, ardour_files + vst_files + coreaudio_files + timefx_sources + audiounit_files, env)
344 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
346 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
348 env.Alias('tarball', env.Distribute (env['DISTTREE'],
349 [ 'SConscript', 'i18n.h', 'gettext.h' ] +
350 [ 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
351 [ 'rb_effect.cc', 'st_stretch.cc', 'st_pitch.cc' ] +
358 glob.glob('po/*.po') + glob.glob('ardour/*.h')))