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 = 1, 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("""
62 control_protocol_manager.cc
67 destructive_filesource.cc
115 arch_specific_objects = [ ]
117 osc_files = [ 'osc.cc' ]
118 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
119 audiounit_files = [ 'audio_unit.cc' ]
120 coreaudio_files = [ 'coreaudiosource.cc' ]
124 extra_sources += vst_files
125 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
128 extra_sources += osc_files
130 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
131 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
132 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\""+final_prefix+"/lib\\\"")
133 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\""+final_config_prefix+"\\\"")
134 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
136 ardour.Merge ([ libraries['jack'] ])
139 # See if JACK supports jack_client_open()
142 jack_test_source_file = """
143 #include <jack/jack.h>
144 int main(int argc, char **argv)
146 jack_client_open ("foo", 0, 0);
150 def CheckJackClientOpen(context):
151 context.Message('Checking for jack_client_open()...')
152 result = context.TryLink(jack_test_source_file, '.c')
153 context.Result(result)
157 # See if JACK supports jack_recompute_total_latencies()
160 jack_test_source_file = """
161 #include <jack/jack.h>
162 int main(int argc, char **argv)
164 jack_recompute_total_latencies ((jack_client_t*) 0);
168 def CheckJackRecomputeLatencies(context):
169 context.Message('Checking for jack_recompute_total_latencies()...')
170 result = context.TryLink(jack_test_source_file, '.c')
171 context.Result(result)
174 jack_video_frame_offset_test = """
175 #include <jack/transport.h>
176 int main(int argc, char** argv)
180 pos.valid & JackVideoFrameOffset;
185 def CheckJackVideoFrameOffset(context):
186 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
187 result = context.TryLink(jack_video_frame_offset_test, '.c')
188 context.Result(result)
191 conf = Configure(ardour, custom_tests = {
192 'CheckJackClientOpen' : CheckJackClientOpen,
193 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
194 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
197 if conf.CheckJackClientOpen():
198 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
200 if conf.CheckJackRecomputeLatencies():
201 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
203 if conf.CheckJackVideoFrameOffset():
204 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
206 if conf.CheckFunc('jack_port_ensure_monitor'):
207 env.Append(CCFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
209 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
212 # Optional header files
215 if conf.CheckCHeader('wordexp.h'):
216 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
218 if conf.CheckCHeader('sys/vfs.h'):
219 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
221 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
222 ardour.Append(LINKFLAGS="-framework CoreMIDI")
224 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
225 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
226 ardour.Append(LINKFLAGS="-framework AudioUnit")
227 extra_sources += audiounit_files
229 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h') and ardour['COREAUDIO']:
230 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
231 ardour.Append(LINKFLAGS="-framework AudioToolbox")
232 extra_sources += coreaudio_files
234 if env['CONFIG_ARCH'] == 'apple':
235 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
236 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
238 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
240 ardour = conf.Finish ()
245 libraries['sndfile'],
248 libraries['samplerate'],
251 libraries['soundtouch'],
252 libraries['midi++2'],
258 ardour.Merge ([ libraries['lo'] ])
260 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
261 ardour.Merge ([ libraries['appleutility'] ])
263 ardour.VersionBuild(['version.cc', 'ardour/version.h'], 'SConscript')
265 def SharedAsmObjectEmitter(target, source, env):
267 tgt.attributes.shared = 1
268 return (target, source)
271 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
272 emitter = SharedAsmObjectEmitter,
273 suffix = '$SHOBJSUFFIX',
277 if env['FPU_OPTIMIZATION']:
278 if env['DIST_TARGET'] == "i386":
279 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
280 if env['DIST_TARGET'] == "i686":
281 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
282 if env['DIST_TARGET'] == "x86_64":
283 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
285 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
290 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
293 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libardour))
295 env.Alias('tarball', env.Distribute (env['DISTTREE'],
296 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
297 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
298 glob.glob('po/*.po') + glob.glob('ardour/*.h')))