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("""
46 control_protocol_manager.cc
51 destructive_filesource.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=\\\""+final_prefix+"/share\\\"")
118 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\""+final_prefix+"/lib\\\"")
119 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\""+final_config_prefix+"\\\"")
120 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+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;
171 def CheckJackVideoFrameOffset(context):
172 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
173 result = context.TryLink(jack_video_frame_offset_test, '.c')
174 context.Result(result)
177 conf = Configure(ardour, custom_tests = {
178 'CheckJackClientOpen' : CheckJackClientOpen,
179 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
180 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
183 if conf.CheckJackClientOpen():
184 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
186 if conf.CheckJackRecomputeLatencies():
187 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
189 if conf.CheckJackVideoFrameOffset():
190 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
192 if conf.CheckFunc('jack_port_ensure_monitor'):
193 env.Append(CCFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
195 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
198 # Optional header files
201 if conf.CheckCHeader('wordexp.h'):
202 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
204 if conf.CheckCHeader('sys/vfs.h'):
205 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
207 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
208 ardour.Append(LINKFLAGS="-framework CoreMIDI")
210 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
211 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
212 ardour.Append(LINKFLAGS="-framework AudioUnit")
213 extra_sources += audiounit_files
215 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h') and ardour['COREAUDIO']:
216 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
217 ardour.Append(LINKFLAGS="-framework AudioToolbox")
218 extra_sources += coreaudio_files
220 if env['CONFIG_ARCH'] == 'apple':
221 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
222 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
224 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
226 ardour = conf.Finish ()
231 libraries['sndfile'],
234 libraries['samplerate'],
237 libraries['soundtouch'],
238 libraries['midi++2'],
244 ardour.Merge ([ libraries['lo'] ])
246 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
247 ardour.Merge ([ libraries['appleutility'] ])
249 ardour.VersionBuild(['version.cc', 'ardour/version.h'], 'SConscript')
251 def SharedAsmObjectEmitter(target, source, env):
253 tgt.attributes.shared = 1
254 return (target, source)
257 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
258 emitter = SharedAsmObjectEmitter,
259 suffix = '$SHOBJSUFFIX',
263 if env['FPU_OPTIMIZATION']:
264 if env['DIST_TARGET'] == "i386":
265 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
266 if env['DIST_TARGET'] == "i686":
267 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
268 if env['DIST_TARGET'] == "x86_64":
269 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
271 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
276 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
279 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libardour))
281 env.Alias('tarball', env.Distribute (env['DISTTREE'],
282 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
283 ardour_files + vst_files + coreaudio_files + audiounit_files +
284 glob.glob('po/*.po') + glob.glob('ardour/*.h')))