jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.0KB

  1. #
  2. # Copyright (C) 2007 Arnold Krille
  3. # Copyright (C) 2007 Pieter Palmers
  4. # Copyright (C) 2008 Marc-Olivier Barre
  5. #
  6. # This file originates from FFADO (www.ffado.org)
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. import os
  22. import glob
  23. from string import Template
  24. Import('env')
  25. # Define the library suffix for POSIX like systems
  26. if env['PLATFORM'] == 'posix':
  27. env.AppendUnique(SHLIBSUFFIX='.0.0')
  28. # Paths where include files can be found
  29. env.AppendUnique(CPPPATH=['#/', '#/common', '#/common/jack'])
  30. # Needed libraries
  31. env.AppendUnique(LIBS=['rt', 'pthread'])
  32. # HACK: this should not be here ideally
  33. env.AppendUnique(CPPPATH=['#/linux','#/macosx'])
  34. # A symlinking command for our libraries' names
  35. symlinkcmd = 'ln -nsf $SOURCE.name $TARGET'
  36. # Library names
  37. clientlib_name = 'jackmp'
  38. serverlib_name = 'jackservermp'
  39. wrapperlib_name = 'jackwrapper'
  40. #
  41. # Source files section
  42. #
  43. srcfiles_common_serverlib = [
  44. 'JackActivationCount.cpp',
  45. 'JackAPI.cpp',
  46. 'JackAudioDriver.cpp',
  47. 'JackClient.cpp',
  48. 'JackConnectionManager.cpp',
  49. 'JackDriver.cpp',
  50. 'JackEngine.cpp',
  51. 'JackEngineControl.cpp',
  52. 'JackError.c',
  53. 'JackExternalClient.cpp',
  54. 'JackFrameTimer.cpp',
  55. 'JackFreewheelDriver.cpp',
  56. 'JackGlobalsServer.cpp',
  57. 'JackGraphManager.cpp',
  58. 'JackInternalClient.cpp',
  59. 'JackPort.cpp',
  60. 'JackPosixSemaphore.cpp',
  61. 'JackPosixThread.cpp',
  62. 'JackFifo.cpp',
  63. 'JackLoopbackDriver.cpp',
  64. 'JackPortType.cpp',
  65. 'JackAudioPort.cpp',
  66. 'JackMidiPort.cpp',
  67. 'JackMidiAPI.cpp',
  68. 'JackServer.cpp',
  69. 'JackShmMem.cpp',
  70. 'JackThreadedDriver.cpp',
  71. 'shm.c',
  72. 'JackSocket.cpp',
  73. 'JackSocketServerChannel.cpp',
  74. 'JackSocketNotifyChannel.cpp',
  75. 'JackSocketServerNotifyChannel.cpp',
  76. 'JackTime.c',
  77. 'JackServerAPI.cpp',
  78. 'JackGlobals.cpp',
  79. 'JackDriverLoader.cpp',
  80. 'JackDebugClient.cpp',
  81. 'JackTransportEngine.cpp',
  82. 'JackServerGlobals.cpp',
  83. 'JackServerLaunch.cpp',
  84. 'timestamps.c',
  85. 'JackTools.cpp',
  86. 'ringbuffer.c'
  87. ]
  88. srcfiles_common_clientlib = [
  89. 'JackActivationCount.cpp',
  90. 'JackAPI.cpp',
  91. 'JackClient.cpp',
  92. 'JackConnectionManager.cpp',
  93. 'ringbuffer.c',
  94. 'JackServerLaunch.cpp',
  95. 'JackError.c',
  96. 'JackFrameTimer.cpp',
  97. 'JackGlobalsClient.cpp',
  98. 'JackGraphManager.cpp',
  99. 'JackLibClient.cpp',
  100. 'JackLibAPI.cpp',
  101. 'JackPort.cpp',
  102. 'JackPosixSemaphore.cpp',
  103. 'JackFifo.cpp',
  104. 'JackPortType.cpp',
  105. 'JackAudioPort.cpp',
  106. 'JackMidiPort.cpp',
  107. 'JackMidiAPI.cpp',
  108. 'JackEngineControl.cpp',
  109. 'JackPosixThread.cpp',
  110. 'JackShmMem.cpp',
  111. 'shm.c',
  112. 'JackSocket.cpp',
  113. 'JackSocketClientChannel.cpp',
  114. 'JackTime.c',
  115. 'JackGlobals.cpp',
  116. 'JackDebugClient.cpp',
  117. 'JackTransportEngine.cpp',
  118. 'timestamps.c',
  119. 'JackTools.cpp'
  120. ]
  121. srcfiles_common_wrapperlib = [
  122. 'JackAPIWrapper.cpp',
  123. 'ringbuffer.c'
  124. ]
  125. jack_headers = [
  126. 'intclient.h',
  127. 'jack.h',
  128. 'midiport.h',
  129. 'ringbuffer.h',
  130. 'statistics.h',
  131. 'thread.h',
  132. 'transport.h',
  133. 'types.h'
  134. ]
  135. #
  136. # Build/install section
  137. #
  138. # Libraries
  139. clientlib = env.SharedLibrary(env['CLIENTLIB'], srcfiles_common_clientlib)
  140. serverlib = env.SharedLibrary(env['SERVERLIB'], srcfiles_common_serverlib)
  141. wrapperlib = env.SharedLibrary(env['WRAPPERLIB'], srcfiles_common_wrapperlib)
  142. env.Install( env['LIBDIR'], [clientlib, serverlib, wrapperlib])
  143. env.Alias('install', env['LIBDIR'])
  144. # Handle the way we name libraries on a POSIX system
  145. # TODO: this is not quite clean yet. changing the library version is a pain we'll need a nicer loop and a config value somewhere
  146. if env['PLATFORM'] == 'posix':
  147. for lib_name, lib in [(env['CLIENTLIB'], clientlib), (env['SERVERLIB'], serverlib), (env['WRAPPERLIB'], wrapperlib)]:
  148. env.Command('#/common/lib' + lib_name + '.so.0', lib, symlinkcmd)
  149. env.Command('#/common/lib' + lib_name + '.so', '#/common/lib'+lib_name+'.so.0', symlinkcmd)
  150. env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so.0', env['LIBDIR'] + '/lib' + lib_name + '.so.0.0', symlinkcmd)
  151. env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so', env['LIBDIR'] + '/lib' + lib_name + '.so.0', symlinkcmd)
  152. env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so.0')
  153. env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so')
  154. # Headers
  155. for header in jack_headers:
  156. env.Install(env['INCLUDEDIR'] + '/jack', 'jack/' + header)
  157. env.Alias('install', env['INCLUDEDIR'])