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("""
32 filename_extensions.cc
63 control_protocol_manager.cc
116 arch_specific_objects = [ ]
118 osc_files = [ 'osc.cc' ]
119 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
120 audiounit_files = [ 'audio_unit.cc' ]
121 coreaudio_files = [ 'coreaudiosource.cc' ]
125 extra_sources += vst_files
126 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
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="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
135 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
137 ardour.Merge ([ libraries['jack'] ])
140 # See if JACK supports jack_client_open()
143 jack_test_source_file = """
144 #include <jack/jack.h>
145 int main(int argc, char **argv)
147 jack_client_open ("foo", 0, 0);
151 def CheckJackClientOpen(context):
152 context.Message('Checking for jack_client_open()...')
153 result = context.TryLink(jack_test_source_file, '.c')
154 context.Result(result)
158 # See if JACK supports jack_recompute_total_latencies()
161 jack_test_source_file = """
162 #include <jack/jack.h>
163 int main(int argc, char **argv)
165 jack_recompute_total_latencies ((jack_client_t*) 0);
169 def CheckJackRecomputeLatencies(context):
170 context.Message('Checking for jack_recompute_total_latencies()...')
171 result = context.TryLink(jack_test_source_file, '.c')
172 context.Result(result)
175 jack_video_frame_offset_test = """
176 #include <jack/transport.h>
177 int main(int argc, char** argv)
181 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)
192 # See if JACK supports jack_port_ensure_monitor_input()
194 jack_ensure_monitor_input_test = """
195 #include <jack/jack.h>
196 int main(int argc, char** argv)
200 jack_port_ensure_monitor (*port, 1);
206 def CheckJackEnsureMonitorInput(context):
207 context.Message('Checking for jack_port_ensure_monitor_input()...')
208 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
209 context.Result(result)
212 conf = Configure(ardour, custom_tests = {
213 'CheckJackClientOpen' : CheckJackClientOpen,
214 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
215 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
216 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
219 if conf.CheckJackClientOpen():
220 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
222 if conf.CheckJackRecomputeLatencies():
223 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
225 if conf.CheckJackVideoFrameOffset():
226 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
228 if conf.CheckJackEnsureMonitorInput():
229 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
231 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
234 # Optional header files
237 if conf.CheckCHeader('wordexp.h'):
238 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
240 if conf.CheckCHeader('sys/vfs.h'):
241 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
243 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
244 ardour.Append(LINKFLAGS="-framework CoreMIDI")
246 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
247 ardour.Append(LINKFLAGS="-framework AudioToolbox")
249 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
250 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
252 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
253 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
254 ardour.Append(LINKFLAGS="-framework AudioUnit")
255 extra_sources += audiounit_files
257 if ardour['COREAUDIO']:
258 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
259 extra_sources += coreaudio_files
261 if env['CONFIG_ARCH'] == 'apple':
262 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
263 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
265 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
267 ardour = conf.Finish ()
272 libraries['sndfile-ardour'],
275 libraries['samplerate'],
278 libraries['soundtouch'],
279 libraries['midi++2'],
285 ardour.Merge ([ libraries['lo'] ])
287 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
288 ardour.Merge ([ libraries['appleutility'] ])
290 def SharedAsmObjectEmitter(target, source, env):
292 tgt.attributes.shared = 1
293 return (target, source)
296 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
297 emitter = SharedAsmObjectEmitter,
298 suffix = '$SHOBJSUFFIX',
302 # handle objects that should always be compiled with -msse in their own
303 # special environment, which is exactly like "ardour" but unconditionally
308 always_sse_objects = []
309 sse_env = ardour.Copy()
310 sse_env.Append (CXXFLAGS="-msse")
312 if env['FPU_OPTIMIZATION']:
313 if env['DIST_TARGET'] == "i386":
314 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
315 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
316 if env['DIST_TARGET'] == "i686":
317 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
318 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
319 if env['DIST_TARGET'] == "x86_64":
320 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
321 always_sse_objects += [ sse_env.SharedObject (source = 'sse_functions_xmm.cc') ]
323 libardour = ardour.SharedLibrary('ardour', ardour_files + always_sse_objects + extra_sources + arch_specific_objects)
328 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
331 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
333 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
335 env.Alias('tarball', env.Distribute (env['DISTTREE'],
336 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions_xmm.cc', 'sse_functions.s', 'sse_functions_64bit.s' ] +
337 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
338 glob.glob('po/*.po') + glob.glob('ardour/*.h')))