8 conf.env['BUILD_NETLIB'] = conf.env['SAMPLERATE']
9 conf.env['BUILD_ADAPTER'] = conf.env['SAMPLERATE']
11 if conf.env['IS_WINDOWS']:
13 conf.check(function_name='regcomp', header_name='regex.h', lib='regex', uselib_store='REGEX', define_name='HAVE_REGEX_H')
15 conf.check(function_name='regcomp', header_name='regex.h', lib='tre', uselib_store='REGEX', define_name='HAVE_REGEX_H')
16 conf.check(function_name='htons', header_name='winsock2.h', lib='ws2_32', uselib_store='WS2_32', define_name='HAVE_WINSOCK2_H')
17 conf.check(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store='WINMM', define_name='HAVE_MMSYSTEM_H')
18 conf.check(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store='PSAPI', define_name='HAVE_PSAPI_H')
20 def create_jack_process_obj(bld, target, sources, uselib = None, framework = None):
21 process = bld(features = ['cxx', 'cxxshlib'])
22 if not bld.env['IS_WINDOWS']:
23 process.env['cxxshlib_PATTERN'] = '%s.so'
24 process.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
25 if bld.env['IS_MACOSX']:
27 process.framework = framework
28 env_includes = ['../macosx', '../posix', '../macosx/coreaudio']
29 if bld.env['IS_LINUX']:
30 env_includes = ['../linux', '../posix', '../linux/alsa']
32 env_includes = ['../solaris', '../posix', '../solaris/oss']
33 if bld.env['IS_WINDOWS']:
34 env_includes = ['../windows', '../windows/portaudio']
35 process.includes = ['.'] + env_includes + ['jack', '..']
37 process.target = target
38 process.source = sources
39 if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']:
40 process.env.append_value('CPPFLAGS', '-fvisibility=hidden')
41 process.install_path = '${ADDON_DIR}/'
42 process.use = [uselib.name]
47 'JackActivationCount.cpp',
50 'JackConnectionManager.cpp',
55 'JackGraphManager.cpp',
61 'JackEngineControl.cpp',
63 'JackGenericClientChannel.cpp',
66 'JackTransportEngine.cpp',
68 'JackMessageBuffer.cpp',
69 'JackEngineProfiling.cpp',
72 includes = ['.', './jack']
76 includes.append('../..')
77 uselib = ['PTHREAD', 'CELT', 'OPUS', 'DB']
79 if bld.env['IS_LINUX']:
80 common_libsources += [
81 'JackDebugClient.cpp',
84 '../posix/JackPosixThread.cpp',
85 '../posix/JackPosixProcessSync.cpp',
86 '../posix/JackPosixMutex.cpp',
87 '../posix/JackSocket.cpp',
88 '../linux/JackLinuxFutex.cpp',
89 '../linux/JackLinuxTime.c',
91 includes = ['../linux', '../posix'] + includes
96 common_libsources += [
97 'JackDebugClient.cpp',
100 '../posix/JackPosixThread.cpp',
101 '../posix/JackFifo.cpp',
102 '../posix/JackPosixProcessSync.cpp',
103 '../posix/JackPosixMutex.cpp',
104 '../posix/JackSocket.cpp',
105 '../solaris/JackSolarisTime.c',
107 includes = ['../solaris', '../posix'] + includes
110 if bld.env['IS_MACOSX']:
111 common_libsources += [
112 'JackDebugClient.cpp',
115 '../posix/JackPosixProcessSync.cpp',
116 '../posix/JackPosixThread.cpp',
117 '../posix/JackPosixMutex.cpp',
118 '../macosx/JackMachThread.mm',
119 #'../macosx/JackMachSemaphore.mm',
120 '../posix/JackPosixSemaphore.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 if bld.env['IS_MACOSX']:
142 clientlib.framework = ['CoreAudio', 'Accelerate']
143 clientlib.defines = 'HAVE_CONFIG_H'
144 clientlib.use = uselib
145 if bld.env['IS_WINDOWS']:
146 clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll'
147 clientlib.install_path = '${BINDIR}'
149 clientlib.install_path = '${LIBDIR}'
150 if bld.env['AUTOSTART_METHOD'] == 'dbus':
151 clientlib.use.append('DBUS-1')
152 clientlib.includes = includes
153 clientlib.name = 'clientlib'
154 clientlib.target = 'jack'
155 clientlib.source = [] + common_libsources
156 clientlib.source += [
162 if bld.env['IS_LINUX']:
163 clientlib.source += [
164 '../posix/JackSocketClientChannel.cpp',
165 '../posix/JackPosixServerLaunch.cpp',
168 if bld.env['IS_SUN']:
169 clientlib.source += [
170 '../posix/JackSocketClientChannel.cpp',
171 '../posix/JackPosixServerLaunch.cpp',
174 if bld.env['IS_MACOSX']:
175 clientlib.source += [
176 '../posix/JackSocketClientChannel.cpp',
177 '../posix/JackPosixServerLaunch.cpp',
180 if bld.env['IS_WINDOWS']:
181 clientlib.source += [
182 '../windows/JackWinNamedPipe.cpp',
183 '../windows/JackWinNamedPipeClientChannel.cpp',
184 '../windows/JackWinServerLaunch.cpp',
185 '../windows/JackMMCSS.cpp',
188 clientlib.vnum = bld.env['JACK_API_VERSION']
190 if bld.env['IS_LINUX']:
191 clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
193 if bld.env['IS_MACOSX']:
194 clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
195 clientlib.env.append_value('LINKFLAGS', '-single_module')
197 if bld.env['IS_SUN']:
198 clientlib.env.append_value('LINKFLAGS', '-lnsl -lsocket')
201 # if there is variant defined, we expect it to be the 32bit client lib one
202 # we don't want to build other stuff in this variant
205 serverlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
206 if bld.env['IS_MACOSX']:
207 serverlib.framework = ['CoreAudio', 'CoreFoundation', 'Accelerate']
208 serverlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
209 serverlib.includes = includes
210 serverlib.name = 'serverlib'
211 serverlib.target = 'jackserver'
212 serverlib.use = uselib
213 if bld.env['IS_WINDOWS']:
214 serverlib.env['cxxshlib_PATTERN'] = 'lib%s.dll'
215 serverlib.install_path = '${BINDIR}'
217 serverlib.install_path = '${LIBDIR}'
218 serverlib.source = [] + common_libsources
219 serverlib.source += [
220 'JackAudioDriver.cpp',
221 'JackTimedDriver.cpp',
222 'JackMidiDriver.cpp',
225 'JackExternalClient.cpp',
226 'JackFreewheelDriver.cpp',
227 'JackInternalClient.cpp',
228 'JackInternalSessionLoader.cpp',
230 'JackThreadedDriver.cpp',
231 'JackRestartThreadedDriver.cpp',
232 'JackWaitThreadedDriver.cpp',
233 'JackWaitCallbackDriver.cpp',
235 'JackDriverLoader.cpp',
236 'JackServerGlobals.cpp',
237 'JackControlAPI.cpp',
239 'JackNetInterface.cpp',
241 'JackRequestDecoder.cpp',
242 'JackMidiAsyncQueue.cpp',
243 'JackMidiAsyncWaitQueue.cpp',
244 'JackMidiBufferReadQueue.cpp',
245 'JackMidiBufferWriteQueue.cpp',
246 'JackMidiRawInputWriteQueue.cpp',
247 'JackMidiRawOutputWriteQueue.cpp',
248 'JackMidiReadQueue.cpp',
249 'JackMidiReceiveQueue.cpp',
250 'JackMidiSendQueue.cpp',
252 'JackMidiWriteQueue.cpp',
256 if bld.env['IS_LINUX']:
257 serverlib.source += [
258 '../posix/JackSocketServerChannel.cpp',
259 '../posix/JackSocketNotifyChannel.cpp',
260 '../posix/JackSocketServerNotifyChannel.cpp',
261 '../posix/JackNetUnixSocket.cpp',
264 if bld.env['IS_SUN']:
265 serverlib.source += [
266 '../posix/JackSocketServerChannel.cpp',
267 '../posix/JackSocketNotifyChannel.cpp',
268 '../posix/JackSocketServerNotifyChannel.cpp',
269 '../posix/JackNetUnixSocket.cpp',
272 if bld.env['IS_MACOSX']:
273 serverlib.source += [
274 '../posix/JackSocketServerChannel.cpp',
275 '../posix/JackSocketNotifyChannel.cpp',
276 '../posix/JackSocketServerNotifyChannel.cpp',
277 '../posix/JackNetUnixSocket.cpp',
280 if bld.env['IS_WINDOWS']:
281 serverlib.source += [
282 '../windows/JackMMCSS.cpp',
283 '../windows/JackWinNamedPipe.cpp',
284 '../windows/JackWinNamedPipeServerChannel.cpp',
285 '../windows/JackWinNamedPipeServerNotifyChannel.cpp',
286 '../windows/JackWinNamedPipeNotifyChannel.cpp',
287 '../windows/JackNetWinSocket.cpp',
290 serverlib.vnum = bld.env['JACK_API_VERSION']
292 if bld.env['IS_LINUX']:
293 serverlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
295 if bld.env['IS_MACOSX']:
296 serverlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
297 serverlib.env.append_value('LINKFLAGS', '-single_module')
299 if bld.env['IS_SUN']:
300 serverlib.env.append_value('LINKFLAGS', '-lnsl -lsocket')
302 if bld.env['BUILD_NETLIB']:
303 netlib = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
304 if bld.env['IS_MACOSX']:
305 netlib.framework = ['CoreAudio']
306 netlib.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
307 netlib.includes = includes
308 netlib.name = 'netlib'
309 netlib.target = 'jacknet'
310 netlib.use = ['SAMPLERATE', 'CELT', 'OPUS', 'PTHREAD']
311 if bld.env['IS_WINDOWS']:
312 netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll'
313 netlib.install_path = '${BINDIR}'
314 netlib.use += ['WS2_32', 'WINMM']
315 elif bld.env['IS_MACOSX']:
316 netlib.install_path = '${LIBDIR}'
319 netlib.install_path = '${LIBDIR}'
322 'JackNetInterface.cpp',
325 'JackAudioAdapterInterface.cpp',
326 'JackLibSampleRateResampler.cpp',
331 if bld.env['IS_LINUX']:
332 netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../linux/JackLinuxTime.c']
333 netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
335 if bld.env['IS_SUN']:
336 netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../solaris/JackSolarisTime.c']
337 netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
340 if bld.env['IS_MACOSX']:
341 netlib.source += ['../posix/JackNetUnixSocket.cpp','../posix/JackPosixThread.cpp', '../posix/JackPosixMutex.cpp', '../macosx/JackMachThread.mm', '../macosx/JackMachTime.c']
342 netlib.env.append_value('LINKFLAGS', '-single_module')
344 if bld.env['IS_WINDOWS']:
345 netlib.source += ['../windows/JackNetWinSocket.cpp','../windows/JackWinThread.cpp', '../windows/JackMMCSS.cpp', '../windows/JackWinTime.c']
347 netlib.vnum = bld.env['JACK_API_VERSION']
349 create_jack_process_obj(bld, 'netmanager', 'JackNetManager.cpp', serverlib)
351 create_jack_process_obj(bld, 'profiler', 'JackProfiler.cpp', serverlib)
353 net_adapter_sources = [
355 'JackLibSampleRateResampler.cpp',
356 'JackAudioAdapter.cpp',
357 'JackAudioAdapterInterface.cpp',
358 'JackNetAdapter.cpp',
361 if bld.env['BUILD_ADAPTER']:
362 process = create_jack_process_obj(bld, 'netadapter', net_adapter_sources, serverlib)
363 process.use += ['SAMPLERATE']
365 audio_adapter_sources = [
367 'JackLibSampleRateResampler.cpp',
368 'JackAudioAdapter.cpp',
369 'JackAudioAdapterInterface.cpp',
370 'JackAudioAdapterFactory.cpp',
373 if bld.env['BUILD_ADAPTER'] and bld.env['IS_MACOSX']:
374 audio_adapter_sources += ['../macosx/coreaudio/JackCoreAudioAdapter.mm']
375 process = create_jack_process_obj(bld,
377 audio_adapter_sources,
386 process.use += ['SAMPLERATE']
388 if bld.env['BUILD_ADAPTER'] and bld.env['IS_LINUX'] and bld.env['BUILD_DRIVER_ALSA']:
389 audio_adapter_sources += ['../linux/alsa/JackAlsaAdapter.cpp']
390 process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
391 process.use += ['ALSA', 'SAMPLERATE']
393 if bld.env['BUILD_ADAPTER'] and bld.env['IS_SUN']:
394 audio_adapter_sources += ['../solaris/oss/JackOSSAdapter.cpp', 'memops.c']
395 process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
396 process.use += 'SAMPLERATE'
398 if bld.env['BUILD_ADAPTER'] and bld.env['IS_WINDOWS']:
399 audio_adapter_sources += ['../windows/portaudio/JackPortAudioAdapter.cpp', '../windows/portaudio/JackPortAudioDevices.cpp']
400 process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
401 process.use += ['SAMPLERATE', 'PORTAUDIO']
404 bld.install_files('${PREFIX}/include/jack', bld.path.ant_glob('jack/*.h'))
406 # process jack.pc.in -> jack.pc
408 features = 'subst_pc',
409 source = '../jack.pc.in',
411 install_path = '${LIBDIR}/pkgconfig/',
412 INCLUDEDIR = os.path.normpath(bld.env['PREFIX'] + '/include'),
413 SERVERLIB = serverlib.target,