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
100 arch_specific_objects = [ ]
102 osc_files = [ 'osc.cc' ]
103 vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
104 audiounit_files = [ 'audio_unit.cc' ]
105 coreaudio_files = [ 'coreaudiosource.cc' ]
109 extra_sources += vst_files
110 ardour.Append(CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
113 extra_sources += osc_files
115 ardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
116 ardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
117 ardour.Append(CXXFLAGS="-DMODULE_DIR=\\\""+final_prefix+"/lib\\\"")
118 ardour.Append(CXXFLAGS="-DCONFIG_DIR=\\\""+final_config_prefix+"\\\"")
119 ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
121 ardour.Merge ([ libraries['jack'] ])
124 # See if JACK supports jack_client_open()
127 jack_test_source_file = """
128 #include <jack/jack.h>
129 int main(int argc, char **argv)
131 jack_client_open ("foo", 0, 0);
135 def CheckJackClientOpen(context):
136 context.Message('Checking for jack_client_open()...')
137 result = context.TryLink(jack_test_source_file, '.c')
138 context.Result(result)
142 # See if JACK supports jack_recompute_total_latencies()
145 jack_test_source_file = """
146 #include <jack/jack.h>
147 int main(int argc, char **argv)
149 jack_recompute_total_latencies ((jack_client_t*) 0);
153 def CheckJackRecomputeLatencies(context):
154 context.Message('Checking for jack_recompute_total_latencies()...')
155 result = context.TryLink(jack_test_source_file, '.c')
156 context.Result(result)
159 jack_video_frame_offset_test = """
160 #include <jack/transport.h>
161 int main(int argc, char** argv)
165 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)
176 conf = Configure(ardour, custom_tests = {
177 'CheckJackClientOpen' : CheckJackClientOpen,
178 'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
179 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
182 if conf.CheckJackClientOpen():
183 ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
185 if conf.CheckJackRecomputeLatencies():
186 ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
188 if conf.CheckJackVideoFrameOffset():
189 ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
191 if conf.CheckFunc('jack_port_ensure_monitor'):
192 env.Append(CCFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
194 print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
197 # Optional header files
200 if conf.CheckCHeader('wordexp.h'):
201 ardour.Append(CXXFLAGS="-DHAVE_WORDEXP")
203 if conf.CheckCHeader('sys/vfs.h'):
204 ardour.Append(CXXFLAGS="-DHAVE_SYS_VFS_H")
206 if conf.CheckCHeader('/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h'):
207 ardour.Append(LINKFLAGS="-framework CoreMIDI")
209 if conf.CheckCHeader('/System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnit.h') and ardour['AUDIOUNITS']:
210 ardour.Append(CXXFLAGS="-DHAVE_AUDIOUNITS")
211 ardour.Append(LINKFLAGS="-framework AudioUnit")
212 extra_sources += audiounit_files
214 if conf.CheckCHeader('/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h') and ardour['COREAUDIO']:
215 ardour.Append(CXXFLAGS="-DHAVE_COREAUDIO")
216 ardour.Append(LINKFLAGS="-framework AudioToolbox")
217 extra_sources += coreaudio_files
219 if env['CONFIG_ARCH'] == 'apple':
220 # this next line avoids issues with circular dependencies between libardour and libardour_cp.
221 # it is based on the (entirely reasonable) assumption that a system with CoreAudio is OS X
223 ardour.Append(LINKFLAGS='-undefined suppress -flat_namespace')
225 ardour = conf.Finish ()
230 libraries['sndfile'],
233 libraries['samplerate'],
236 libraries['soundtouch'],
237 libraries['midi++2'],
243 ardour.Merge ([ libraries['lo'] ])
245 if ardour['COREAUDIO'] or ardour['AUDIOUNITS']:
246 ardour.Merge ([ libraries['appleutility'] ])
248 def SharedAsmObjectEmitter(target, source, env):
250 tgt.attributes.shared = 1
251 return (target, source)
254 env['BUILDERS']['SharedAsmObject'] = Builder (action = '$CXX -c -fPIC $SOURCE -o $TARGET',
255 emitter = SharedAsmObjectEmitter,
256 suffix = '$SHOBJSUFFIX',
260 if env['FPU_OPTIMIZATION']:
261 if env['DIST_TARGET'] == "i386":
262 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
263 if env['DIST_TARGET'] == "i686":
264 arch_specific_objects = env.SharedAsmObject('sse_functions.os', 'sse_functions.s')
265 if env['DIST_TARGET'] == "x86_64":
266 arch_specific_objects = env.SharedAsmObject('sse_functions_64bit.os', 'sse_functions_64bit.s')
268 libardour = ardour.SharedLibrary('ardour', ardour_files + extra_sources + arch_specific_objects)
273 i18n (ardour, ardour_files + vst_files + coreaudio_files + audiounit_files, env)
276 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), libardour))
278 env.AlwaysBuild ('version.cc')
279 env.Alias('version', ardour.VersionBuild(['version.cc', 'ardour/version.h'], 'SConscript'))
281 env.Alias('tarball', env.Distribute (env['DISTTREE'],
282 [ 'SConscript', 'i18n.h', 'gettext.h', 'sse_functions.s', 'sse_functions_64bit.s' ] +
283 ardour_files + osc_files + vst_files + coreaudio_files + audiounit_files +
284 glob.glob('po/*.po') + glob.glob('ardour/*.h')))