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("""
62 control_protocol_manager.cc
114 arch_specific_objects = [ ]
116 osc_files = [ 'osc.cc' ]
117 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
118 audiounit_files = [ 'audio_unit.cc' ]
119 coreaudio_files = [ 'coreaudiosource.cc' ]
123 extra_sources += vst_files
124 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
127 extra_sources += osc_files
129 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
130 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\"" + os.path.join (final_prefix, 'share') + "\\\"")
131 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\"" + os.path.join (final_prefix, env['LIBDIR']) + "\\\"")
132 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\"" + final_config_prefix + "\\\"")
133 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share', 'locale') + "\\\"")
135 ardour.Merge ([ libraries['jack'] ])
138 # See if JACK supports jack_client_open()
141 jack_test_source_file = """
142 #include <jack/jack.h>
143 int main(int argc, char **argv)
145 jack_client_open ("foo", 0, 0);
149 def CheckJackClientOpen(context):
150 context.Message('Checking for jack_client_open()...')
151 result = context.TryLink(jack_test_source_file, '.c')
152 context.Result(result)
156 # See if JACK supports jack_recompute_total_latencies()
159 jack_test_source_file = """
160 #include <jack/jack.h>
161 int main(int argc, char **argv)
163 jack_recompute_total_latencies ((jack_client_t*) 0);
167 def CheckJackRecomputeLatencies(context):
168 context.Message('Checking for jack_recompute_total_latencies()...')
169 result = context.TryLink(jack_test_source_file, '.c')
170 context.Result(result)
173 jack_video_frame_offset_test = """
174 #include <jack/transport.h>
175 int main(int argc, char** argv)
179 pos.valid & JackVideoFrameOffset;
183 def CheckJackVideoFrameOffset(context):
184 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
185 result = context.TryLink(jack_video_frame_offset_test, '.c')
186 context.Result(result)
190 # See if JACK supports jack_port_ensure_monitor_input()
192 jack_ensure_monitor_input_test = """
193 #include <jack/jack.h>
194 int main(int argc, char** argv)
198 jack_port_ensure_monitor (*port, 1);
204 def CheckJackEnsureMonitorInput(context):
205 context.Message('Checking for jack_port_ensure_monitor_input()...')
206 result = context.TryLink(jack_ensure_monitor_input_test, '.c')
207 context.Result(result)
210 conf = Configure(ardour, custom_tests = {
211 'CheckJackClientOpen' : CheckJackClientOpen,
212 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
213 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
214 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
217 if conf.CheckJackClientOpen():
218 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
220 if conf.CheckJackRecomputeLatencies():
221 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
223 if conf.CheckJackVideoFrameOffset():
224 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
226 if conf.CheckJackEnsureMonitorInput():
227 ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
229 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
232 # Optional header files
235 if conf.CheckCHeader('wordexp.h'):
236 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
238 if conf.CheckCHeader('sys/vfs.h'):
239 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
241 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
242 ardour.Append(LINKFLAGS="-framework CoreMIDI")
244 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
245 ardour.Append(LINKFLAGS="-framework AudioToolbox")
247 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
248 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
250 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
251 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
252 ardour.Append(LINKFLAGS="-framework AudioUnit")
253 extra_sources += audiounit_files
255 if ardour['COREAUDIO']:
256 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
257 extra_sources += coreaudio_files
259 if env['CONFIG_ARCH'] == 'apple':
260 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
261 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
263 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
265 ardour = conf.Finish ()
270 libraries['sndfile-ardour'],
273 libraries['samplerate'],
276 libraries['soundtouch'],
277 libraries['midi++2'],
283 ardour.Merge ([ libraries['lo'] ])
285 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
286 ardour.Merge ([ libraries['appleutility'] ])
288 def SharedAsmObjectEmitter(target, source, env):
290 tgt.attributes.shared = 1
291 return (target, source)
294 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
295 emitter = SharedAsmObjectEmitter,
296 suffix = '$SHOBJSUFFIX',
300 if env['FPU_OPTIMIZATION']:
301 if env['DIST_TARGET'] == "i386":
302 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
303 if env['DIST_TARGET'] == "i686":
304 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
305 if env['DIST_TARGET'] == "x86_64":
306 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
308 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
313 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
316 env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libardour))
318 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
320 env.Alias('tarball', env.Distribute (env['DISTTREE'],
321 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
322 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
323 glob.glob('po/*.po') + glob.glob('ardour/*.h')))