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(CXXFLAGS="-DGLIBMM_DISABLE_DEPRECATED")
21 ardour.Append(PACKAGE = domain)
22 ardour.Append(POTFILE = domain + '.pot')
25 # explicitly reference the control protocol LGPL library for includes
28 ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
30 ardour_files=Split("""
47 control_protocol_manager.cc
101 arch_specific_objects = [ ]
103 osc_files = [ 'osc.cc' ]
104 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
105 audiounit_files = [ 'audio_unit.cc' ]
106 coreaudio_files = [ 'coreaudiosource.cc' ]
110 extra_sources += vst_files
111 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
114 extra_sources += osc_files
116 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
117 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
118 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
119 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
120 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
122 ardour.Merge ([ libraries['jack'] ])
125 # See if JACK supports jack_client_open()
128 jack_test_source_file = """
129 #include <jack/jack.h>
130 int main(int argc, char **argv)
132 jack_client_open ("foo", 0, 0);
136 def CheckJackClientOpen(context):
137 context.Message('Checking for jack_client_open()...')
138 result = context.TryLink(jack_test_source_file, '.c')
139 context.Result(result)
143 # See if JACK supports jack_recompute_total_latencies()
146 jack_test_source_file = """
147 #include <jack/jack.h>
148 int main(int argc, char **argv)
150 jack_recompute_total_latencies ((jack_client_t*) 0);
154 def CheckJackRecomputeLatencies(context):
155 context.Message('Checking for jack_recompute_total_latencies()...')
156 result = context.TryLink(jack_test_source_file, '.c')
157 context.Result(result)
160 jack_video_frame_offset_test = """
161 #include <jack/transport.h>
162 int main(int argc, char** argv)
166 pos.valid & JackVideoFrameOffset;
170 def CheckJackVideoFrameOffset(context):
171 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
172 result = context.TryLink(jack_video_frame_offset_test, '.c')
173 context.Result(result)
177 # See if JACK supports jack_port_ensure_monitor_input()
179 jack_ensure_monitor_input_test = """
180 #include <jack/jack.h>
181 int main(int argc, char** argv)
185 jack_port_ensure_monitor (*port, 1);
191 def CheckJackEnsureMonitorInput(context):
192 context.Message('Checking for jack_port_ensure_monitor_input()...')
193 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
194 context.Result(result)
197 conf = Configure(ardour, custom_tests = {
198 'CheckJackClientOpen' : CheckJackClientOpen,
199 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
200 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
201 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
204 if conf.CheckJackClientOpen():
205 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
207 if conf.CheckJackRecomputeLatencies():
208 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
210 if conf.CheckJackVideoFrameOffset():
211 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
213 if conf.CheckJackEnsureMonitorInput():
214 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
216 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
219 # Optional header files
222 if conf.CheckCHeader('wordexp.h'):
223 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
225 if conf.CheckCHeader('sys/vfs.h'):
226 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
228 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
229 ardour.Append(LINKFLAGS="-framework CoreMIDI")
231 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
232 ardour.Append(LINKFLAGS="-framework AudioToolbox")
234 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
235 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
237 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
238 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
239 ardour.Append(LINKFLAGS="-framework AudioUnit")
240 extra_sources += audiounit_files
242 if ardour['COREAUDIO']:
243 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
244 extra_sources += coreaudio_files
246 if env['CONFIG_ARCH'] == 'apple':
247 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
248 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
250 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
252 ardour = conf.Finish ()
257 libraries['sndfile-ardour'],
260 libraries['samplerate'],
263 libraries['soundtouch'],
264 libraries['midi++2'],
270 ardour.Merge ([ libraries['lo'] ])
272 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
273 ardour.Merge ([ libraries['appleutility'] ])
275 def SharedAsmObjectEmitter(target, source, env):
277 tgt.attributes.shared = 1
278 return (target, source)
281 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
282 emitter = SharedAsmObjectEmitter,
283 suffix = '$SHOBJSUFFIX',
287 if env['FPU_OPTIMIZATION']:
288 if env['DIST_TARGET'] == "i386":
289 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
290 if env['DIST_TARGET'] == "i686":
291 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
292 if env['DIST_TARGET'] == "x86_64":
293 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
295 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
300 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
303 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
305 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
307 env.Alias('tarball', env.Distribute (env['DISTTREE'],
308 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
309 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
310 glob.glob('po/*.po') + glob.glob('ardour/*.h')))