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("""
46 control_protocol_manager.cc
99 arch_specific_objects = [ ]
101 osc_files = [ 'osc.cc' ]
102 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
103 audiounit_files = [ 'audio_unit.cc' ]
104 coreaudio_files = [ 'coreaudiosource.cc' ]
108 extra_sources += vst_files
109 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
112 extra_sources += osc_files
114 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
115 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
116 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\""+final_prefix+"/lib\\\"")
117 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\""+final_config_prefix+"\\\"")
118 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
120 ardour.Merge ([ libraries['jack'] ])
123 # See if JACK supports jack_client_open()
126 jack_test_source_file = """
127 #include <jack/jack.h>
128 int main(int argc, char **argv)
130 jack_client_open ("foo", 0, 0);
134 def CheckJackClientOpen(context):
135 context.Message('Checking for jack_client_open()...')
136 result = context.TryLink(jack_test_source_file, '.c')
137 context.Result(result)
141 # See if JACK supports jack_recompute_total_latencies()
144 jack_test_source_file = """
145 #include <jack/jack.h>
146 int main(int argc, char **argv)
148 jack_recompute_total_latencies ((jack_client_t*) 0);
152 def CheckJackRecomputeLatencies(context):
153 context.Message('Checking for jack_recompute_total_latencies()...')
154 result = context.TryLink(jack_test_source_file, '.c')
155 context.Result(result)
158 jack_video_frame_offset_test = """
159 #include <jack/transport.h>
160 int main(int argc, char** argv)
164 pos.valid & JackVideoFrameOffset;
169 def CheckJackVideoFrameOffset(context):
170 context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
171 result = context.TryLink(jack_video_frame_offset_test, '.c')
172 context.Result(result)
175 conf = Configure(ardour, custom_tests = {
176 'CheckJackClientOpen' : CheckJackClientOpen,
177 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
178 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
181 if conf.CheckJackClientOpen():
182 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
184 if conf.CheckJackRecomputeLatencies():
185 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
187 if conf.CheckJackVideoFrameOffset():
188 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
190 if conf.CheckFunc('jack_port_ensure_monitor'):
191 env.Append(CCFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
193 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
196 # Optional header files
199 if conf.CheckCHeader('wordexp.h'):
200 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
202 if conf.CheckCHeader('sys/vfs.h'):
203 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
205 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
206 ardour.Append(LINKFLAGS="-framework CoreMIDI")
208 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h'):
209 ardour.Append(LINKFLAGS="-framework AudioToolbox")
211 if conf.CheckCHeader('/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h'):
212 ardour.Append(CXXFLAGS="-DHAVE_WEAK_COREAUDIO")
214 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
215 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
216 ardour.Append(LINKFLAGS="-framework AudioUnit")
217 extra_sources += audiounit_files
219 if ardour['COREAUDIO']:
220 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
221 extra_sources += coreaudio_files
223 if env['CONFIG_ARCH'] == 'apple':
224 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
225 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
227 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
229 ardour = conf.Finish ()
234 libraries['sndfile-ardour'],
237 libraries['samplerate'],
240 libraries['soundtouch'],
241 libraries['midi++2'],
247 ardour.Merge ([ libraries['lo'] ])
249 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
250 ardour.Merge ([ libraries['appleutility'] ])
252 def SharedAsmObjectEmitter(target, source, env):
254 tgt.attributes.shared = 1
255 return (target, source)
258 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
259 emitter = SharedAsmObjectEmitter,
260 suffix = '$SHOBJSUFFIX',
264 if env['FPU_OPTIMIZATION']:
265 if env['DIST_TARGET'] == "i386":
266 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
267 if env['DIST_TARGET'] == "i686":
268 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
269 if env['DIST_TARGET'] == "x86_64":
270 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
272 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
277 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
280 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libardour))
282 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], []))
284 env.Alias('tarball', env.Distribute (env['DISTTREE'],
285 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
286 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
287 glob.glob('po/*.po') + glob.glob('ardour/*.h')))