9 conf
.check_cc(header_name
='samplerate.h', define_name
="HAVE_SAMPLERATE")
11 if conf
.is_defined('HAVE_SAMPLERATE'):
12 conf
.env
['LIB_SAMPLERATE'] = ['samplerate']
14 conf
.env
['BUILD_NETLIB'] = conf
.is_defined('HAVE_SAMPLERATE')
15 conf
.env
['BUILD_ADAPTER'] = conf
.is_defined('HAVE_SAMPLERATE')
17 if conf
.env
['IS_WINDOWS']:
18 conf
.check_cc(function_name
='regcomp', header_name
='regex.h', lib
='regex', uselib_store
="REGEX", define_name
='HAVE_REGEX_H')
19 conf
.check_cc(function_name
='htons', header_name
='winsock2.h', lib
='ws2_32', uselib_store
="WS2_32", define_name
='HAVE_WINSOCK2_H')
20 conf
.check_cc(function_name
='timeGetDevCaps', header_name
=['windows.h', 'mmsystem.h'], lib
='winmm', uselib_store
="WINMM", define_name
='HAVE_MMSYSTEM_H')
21 conf
.check_cc(function_name
='EnumProcesses', header_name
=['windows.h', 'psapi.h'], lib
='psapi', uselib_store
="PSAPI", define_name
='HAVE_PSAPI_H')
23 def create_jack_process_obj(bld
, target
, sources
, uselib
= None):
24 process
= bld(features
= ['cxx', 'cxxshlib'])
25 if not bld
.env
['IS_WINDOWS']:
26 process
.env
['cxxshlib_PATTERN'] = '%s.so'
27 process
.defines
= ['HAVE_CONFIG_H','SERVER_SIDE']
28 if bld
.env
['IS_MACOSX']:
29 env_includes
= ['../macosx', '../posix', '../macosx/coreaudio']
30 if bld
.env
['IS_LINUX']:
31 env_includes
= ['../linux', '../posix', '../linux/alsa']
33 env_includes
= ['../solaris', '../posix', '../solaris/oss']
34 if bld
.env
['IS_WINDOWS']:
35 env_includes
= ['../windows', '../windows/portaudio']
36 process
.includes
= ['.'] + env_includes
+ ['jack', '..']
38 process
.target
= target
39 process
.source
= sources
40 if bld
.env
['IS_LINUX']:
41 process
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
42 if bld
.env
['IS_MACOSX']:
43 process
.env
.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
44 #process.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
45 process
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
46 process
.install_path
= '${ADDON_DIR}/'
47 process
.use
= [uselib
.name
]
52 'JackActivationCount.cpp',
55 'JackConnectionManager.cpp',
60 'JackGraphManager.cpp',
66 'JackEngineControl.cpp',
68 'JackGenericClientChannel.cpp',
71 'JackTransportEngine.cpp',
73 'JackMessageBuffer.cpp',
74 'JackEngineProfiling.cpp',
77 includes
= ['.', './jack']
81 includes
.append('../..')
82 uselib
= ["PTHREAD", "CELT", "OPUS"]
84 if bld
.env
['IS_LINUX']:
85 common_libsources
+= [
86 'JackDebugClient.cpp',
88 '../posix/JackPosixThread.cpp',
89 '../posix/JackPosixSemaphore.cpp',
90 '../posix/JackPosixProcessSync.cpp',
91 '../posix/JackPosixMutex.cpp',
92 '../posix/JackSocket.cpp',
93 '../linux/JackLinuxTime.c',
95 includes
= ['../linux', '../posix'] + includes
100 common_libsources
+= [
101 'JackDebugClient.cpp',
103 '../posix/JackPosixThread.cpp',
104 '../posix/JackFifo.cpp',
105 '../posix/JackPosixProcessSync.cpp',
106 '../posix/JackPosixMutex.cpp',
107 '../posix/JackSocket.cpp',
108 '../solaris/JackSolarisTime.c',
110 includes
= ['../solaris', '../posix'] + includes
113 if bld
.env
['IS_MACOSX']:
114 common_libsources
+= [
115 'JackDebugClient.cpp',
117 '../posix/JackPosixProcessSync.cpp',
118 '../posix/JackPosixThread.cpp',
119 '../macosx/JackMachThread.cpp',
120 '../macosx/JackMachSemaphore.cpp',
121 '../posix/JackSocket.cpp',
122 '../macosx/JackMachTime.c',
124 includes
= ['../macosx', '../macosx/RPC', '../posix'] + includes
126 if bld
.env
['IS_WINDOWS']:
127 common_libsources
+= [
128 '../windows/JackWinMutex.cpp',
129 '../windows/JackWinProcessSync.cpp',
130 '../windows/JackWinSemaphore.cpp',
131 '../windows/JackWinThread.cpp',
132 '../windows/JackWinTime.c',
134 includes
= ['../windows' ] + includes
135 uselib
.append('REGEX')
136 uselib
.append('WS2_32')
137 uselib
.append('PSAPI')
138 uselib
.append('WINMM')
140 clientlib
= bld(features
= ['c', 'cxx', 'cxxshlib', 'cshlib'])
141 clientlib
.defines
= 'HAVE_CONFIG_H'
142 clientlib
.use
= uselib
143 if bld
.env
['IS_WINDOWS']:
144 clientlib
.install_path
= '${BINDIR}'
146 clientlib
.install_path
= '${LIBDIR}'
147 if bld
.env
['AUTOSTART_METHOD'] == "dbus":
148 clientlib
.use
.append('DBUS-1')
149 clientlib
.includes
= includes
150 clientlib
.name
= 'clientlib'
151 clientlib
.target
= 'jack'
152 clientlib
.source
= [] + common_libsources
153 clientlib
.source
+= [
158 if bld
.env
['IS_LINUX']:
159 clientlib
.source
+= [
160 '../posix/JackSocketClientChannel.cpp',
161 '../posix/JackPosixServerLaunch.cpp',
164 if bld
.env
['IS_SUN']:
165 clientlib
.source
+= [
166 '../posix/JackSocketClientChannel.cpp',
167 '../posix/JackPosixServerLaunch.cpp',
170 if bld
.env
['IS_MACOSX']:
171 clientlib
.source
+= [
172 '../posix/JackSocketClientChannel.cpp',
173 '../posix/JackPosixServerLaunch.cpp',
176 if bld
.env
['IS_WINDOWS']:
177 clientlib
.source
+= [
178 '../windows/JackWinNamedPipe.cpp',
179 '../windows/JackWinNamedPipeClientChannel.cpp',
180 '../windows/JackWinServerLaunch.cpp',
181 '../windows/JackMMCSS.cpp',
184 clientlib
.vnum
= bld
.env
['JACK_API_VERSION']
186 if bld
.env
['IS_LINUX']:
187 clientlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
189 if bld
.env
['IS_MACOSX']:
190 clientlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
191 clientlib
.env
.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
192 #clientlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc -arch x86_64"
193 clientlib
.env
.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module")
194 clientlib
.env
.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1")
196 if bld
.env
['IS_SUN']:
197 clientlib
.env
.append_value("LINKFLAGS", "-lnsl -lsocket")
200 # if there is variant defined, we expect it to be the 32bit client lib one
201 # we don't want to build other stuff in this variant
204 serverlib
= bld(features
= ['c', 'cxx', 'cxxshlib', 'cshlib'])
205 serverlib
.defines
= ['HAVE_CONFIG_H','SERVER_SIDE']
206 serverlib
.includes
= includes
207 serverlib
.name
= 'serverlib'
208 serverlib
.target
= 'jackserver'
209 serverlib
.use
= uselib
210 if bld
.env
['IS_WINDOWS']:
211 serverlib
.install_path
= '${BINDIR}'
213 serverlib
.install_path
= '${LIBDIR}'
214 serverlib
.source
= [] + common_libsources
215 serverlib
.source
+= [
216 'JackAudioDriver.cpp',
217 'JackTimedDriver.cpp',
218 'JackMidiDriver.cpp',
221 'JackExternalClient.cpp',
222 'JackFreewheelDriver.cpp',
223 'JackInternalClient.cpp',
225 'JackThreadedDriver.cpp',
226 'JackRestartThreadedDriver.cpp',
227 'JackWaitThreadedDriver.cpp',
229 'JackDriverLoader.cpp',
230 'JackServerGlobals.cpp',
231 'JackControlAPI.cpp',
233 'JackNetInterface.cpp',
235 'JackRequestDecoder.cpp',
236 'JackMidiAsyncQueue.cpp',
237 'JackMidiAsyncWaitQueue.cpp',
238 'JackMidiBufferReadQueue.cpp',
239 'JackMidiBufferWriteQueue.cpp',
240 'JackMidiRawInputWriteQueue.cpp',
241 'JackMidiRawOutputWriteQueue.cpp',
242 'JackMidiReadQueue.cpp',
243 'JackMidiReceiveQueue.cpp',
244 'JackMidiSendQueue.cpp',
246 'JackMidiWriteQueue.cpp'
249 if bld
.env
['IS_LINUX']:
250 serverlib
.source
+= [
251 '../posix/JackSocketServerChannel.cpp',
252 '../posix/JackSocketNotifyChannel.cpp',
253 '../posix/JackSocketServerNotifyChannel.cpp',
254 '../posix/JackNetUnixSocket.cpp',
257 if bld
.env
['IS_SUN']:
258 serverlib
.source
+= [
259 '../posix/JackSocketServerChannel.cpp',
260 '../posix/JackSocketNotifyChannel.cpp',
261 '../posix/JackSocketServerNotifyChannel.cpp',
262 '../posix/JackNetUnixSocket.cpp',
265 if bld
.env
['IS_MACOSX']:
266 serverlib
.source
+= [
267 '../posix/JackSocketServerChannel.cpp',
268 '../posix/JackSocketNotifyChannel.cpp',
269 '../posix/JackSocketServerNotifyChannel.cpp',
270 '../posix/JackNetUnixSocket.cpp',
273 if bld
.env
['IS_WINDOWS']:
274 serverlib
.source
+= [
275 '../windows/JackMMCSS.cpp',
276 '../windows/JackWinNamedPipe.cpp',
277 '../windows/JackWinNamedPipeServerChannel.cpp',
278 '../windows/JackWinNamedPipeServerNotifyChannel.cpp',
279 '../windows/JackWinNamedPipeNotifyChannel.cpp',
280 '../windows/JackNetWinSocket.cpp',
283 serverlib
.vnum
= bld
.env
['JACK_API_VERSION']
285 if bld
.env
['IS_LINUX']:
286 serverlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
288 if bld
.env
['IS_MACOSX']:
289 serverlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
290 serverlib
.env
.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
291 #serverlib.env.append_value("LINKFLAGS", "-framework CoreAudio -framework vecLib -single_module -arch i386 -arch ppc -arch x86_64")
292 serverlib
.env
.append_value("LINKFLAGS", "-framework CoreAudio -framework CoreFoundation -framework vecLib -single_module")
293 serverlib
.env
.append_value("LINKFLAGS", "-compatibility_version 1 -current_version 1")
295 if bld
.env
['IS_SUN']:
296 serverlib
.env
.append_value("LINKFLAGS", "-lnsl -lsocket")
298 if bld
.env
['BUILD_NETLIB'] == True:
299 netlib
= bld(features
= ['c', 'cxx', 'cxxshlib', 'cshlib'])
300 netlib
.defines
= ['HAVE_CONFIG_H','SERVER_SIDE']
301 netlib
.includes
= includes
302 netlib
.name
= 'netlib'
303 netlib
.target
= 'jacknet'
304 netlib
.use
= ['SAMPLERATE', 'CELT', 'OPUS', 'PTHREAD']
305 if bld
.env
['IS_WINDOWS']:
306 netlib
.install_path
= '${BINDIR}'
307 netlib
.use
+= ['WS2_32', 'WINMM']
310 netlib
.install_path
= '${LIBDIR}'
313 'JackNetInterface.cpp',
316 'JackAudioAdapterInterface.cpp',
317 'JackLibSampleRateResampler.cpp',
322 if bld
.env
['IS_LINUX']:
323 netlib
.source
+= ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../linux/JackLinuxTime.c']
324 netlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
326 if bld
.env
['IS_SUN']:
327 netlib
.source
+= ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../solaris/JackSolarisTime.c']
328 netlib
.env
.append_value("CPPFLAGS", "-fvisibility=hidden")
331 if bld
.env
['IS_MACOSX']:
332 netlib
.source
+= ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../macosx/JackMachThread.cpp', '../macosx/JackMachTime.c']
333 netlib
.env
.append_value("LINKFLAGS", "-framework CoreAudio -single_module")
335 if bld
.env
['IS_WINDOWS']:
336 netlib
.source
+= ['../windows/JackNetWinSocket.cpp','../windows/JackWinThread.cpp', '../windows/JackMMCSS.cpp', '../windows/JackWinTime.c']
338 netlib
.vnum
= bld
.env
['JACK_API_VERSION']
340 create_jack_process_obj(bld
, 'netmanager', 'JackNetManager.cpp', serverlib
)
342 create_jack_process_obj(bld
, 'profiler', 'JackProfiler.cpp', serverlib
)
344 net_adapter_sources
= [
346 'JackLibSampleRateResampler.cpp',
347 'JackAudioAdapter.cpp',
348 'JackAudioAdapterInterface.cpp',
349 'JackNetAdapter.cpp',
352 if bld
.env
['BUILD_ADAPTER'] == True:
353 process
= create_jack_process_obj(bld
, 'netadapter', net_adapter_sources
, serverlib
)
354 process
.use
+= ['SAMPLERATE']
356 audio_adapter_sources
= [
358 'JackLibSampleRateResampler.cpp',
359 'JackAudioAdapter.cpp',
360 'JackAudioAdapterInterface.cpp',
361 'JackAudioAdapterFactory.cpp',
364 if bld
.env
['BUILD_ADAPTER'] and bld
.env
['IS_MACOSX']:
365 audio_adapter_sources
+= ['../macosx/coreaudio/JackCoreAudioAdapter.cpp']
366 process
= create_jack_process_obj(bld
, 'audioadapter', audio_adapter_sources
, serverlib
)
367 process
.env
.append_value("LINKFLAGS", "-framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework CoreServices")
368 process
.use
= 'SAMPLERATE'
370 if bld
.env
['BUILD_ADAPTER'] and bld
.env
['IS_LINUX'] and bld
.env
['BUILD_DRIVER_ALSA']:
371 audio_adapter_sources
+= ['../linux/alsa/JackAlsaAdapter.cpp']
372 process
= create_jack_process_obj(bld
, 'audioadapter', audio_adapter_sources
, serverlib
)
373 process
.use
= ['ALSA', 'SAMPLERATE']
375 if bld
.env
['BUILD_ADAPTER'] and bld
.env
['IS_SUN']:
376 audio_adapter_sources
+= ['../solaris/oss/JackOSSAdapter.cpp', 'memops.c']
377 process
= create_jack_process_obj(bld
, 'audioadapter', audio_adapter_sources
, serverlib
)
378 process
.use
= 'SAMPLERATE'
380 if bld
.env
['BUILD_ADAPTER'] and bld
.env
['IS_WINDOWS']:
381 audio_adapter_sources
+= ['../windows/portaudio/JackPortAudioAdapter.cpp', '../windows/portaudio/JackPortAudioDevices.cpp']
382 process
= create_jack_process_obj(bld
, 'audioadapter', audio_adapter_sources
, serverlib
)
383 process
.use
+= ['SAMPLERATE', 'PORTAUDIO']
386 bld
.install_files('${PREFIX}/include/jack', bld
.path
.ant_glob('jack/*.h'))
388 # process jack.pc.in -> jack.pc
390 features
= 'subst_pc',
391 source
= '../jack.pc.in',
393 install_path
= '${LIBDIR}/pkgconfig/',
394 INCLUDEDIR
= os
.path
.normpath(bld
.env
['PREFIX'] + '/include'),
395 SERVERLIB
= serverlib
.target
,