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.

176 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. #
  37. # Source files section
  38. #
  39. srcfiles_common_serverlib = [
  40. 'JackActivationCount.cpp',
  41. 'JackAPI.cpp',
  42. 'JackAudioDriver.cpp',
  43. 'JackClient.cpp',
  44. 'JackConnectionManager.cpp',
  45. 'JackDriver.cpp',
  46. 'JackEngine.cpp',
  47. 'JackEngineControl.cpp',
  48. 'JackError.c',
  49. 'JackExternalClient.cpp',
  50. 'JackFrameTimer.cpp',
  51. 'JackFreewheelDriver.cpp',
  52. 'JackGlobalsServer.cpp',
  53. 'JackGraphManager.cpp',
  54. 'JackInternalClient.cpp',
  55. 'JackPort.cpp',
  56. 'JackPosixSemaphore.cpp',
  57. 'JackPosixThread.cpp',
  58. 'JackFifo.cpp',
  59. 'JackLoopbackDriver.cpp',
  60. 'JackPortType.cpp',
  61. 'JackAudioPort.cpp',
  62. 'JackMidiPort.cpp',
  63. 'JackMidiAPI.cpp',
  64. 'JackServer.cpp',
  65. 'JackShmMem.cpp',
  66. 'JackThreadedDriver.cpp',
  67. 'shm.c',
  68. 'JackSocket.cpp',
  69. 'JackSocketServerChannel.cpp',
  70. 'JackSocketNotifyChannel.cpp',
  71. 'JackSocketServerNotifyChannel.cpp',
  72. 'JackTime.c',
  73. 'JackServerAPI.cpp',
  74. 'JackGlobals.cpp',
  75. 'JackDriverLoader.cpp',
  76. 'JackDebugClient.cpp',
  77. 'JackTransportEngine.cpp',
  78. 'JackServerGlobals.cpp',
  79. 'JackServerLaunch.cpp',
  80. 'timestamps.c',
  81. 'JackTools.cpp',
  82. 'ringbuffer.c'
  83. ]
  84. srcfiles_common_clientlib = [
  85. 'JackActivationCount.cpp',
  86. 'JackAPI.cpp',
  87. 'JackClient.cpp',
  88. 'JackConnectionManager.cpp',
  89. 'ringbuffer.c',
  90. 'JackServerLaunch.cpp',
  91. 'JackError.c',
  92. 'JackFrameTimer.cpp',
  93. 'JackGlobalsClient.cpp',
  94. 'JackGraphManager.cpp',
  95. 'JackLibClient.cpp',
  96. 'JackLibAPI.cpp',
  97. 'JackPort.cpp',
  98. 'JackPosixSemaphore.cpp',
  99. 'JackFifo.cpp',
  100. 'JackPortType.cpp',
  101. 'JackAudioPort.cpp',
  102. 'JackMidiPort.cpp',
  103. 'JackMidiAPI.cpp',
  104. 'JackEngineControl.cpp',
  105. 'JackPosixThread.cpp',
  106. 'JackShmMem.cpp',
  107. 'shm.c',
  108. 'JackSocket.cpp',
  109. 'JackSocketClientChannel.cpp',
  110. 'JackTime.c',
  111. 'JackGlobals.cpp',
  112. 'JackDebugClient.cpp',
  113. 'JackTransportEngine.cpp',
  114. 'timestamps.c',
  115. 'JackTools.cpp'
  116. ]
  117. if not env['FULL_MIMIC']:
  118. srcfiles_common_wrapperlib = [
  119. 'JackAPIWrapper.cpp',
  120. 'ringbuffer.c'
  121. ]
  122. jack_headers = [
  123. 'intclient.h',
  124. 'jack.h',
  125. 'midiport.h',
  126. 'ringbuffer.h',
  127. 'statistics.h',
  128. 'thread.h',
  129. 'transport.h',
  130. 'types.h'
  131. ]
  132. #
  133. # Build/install section
  134. #
  135. # Libraries
  136. clientlib = env.SharedLibrary(env['CLIENTLIB'], srcfiles_common_clientlib)
  137. serverlib = env.SharedLibrary(env['SERVERLIB'], srcfiles_common_serverlib)
  138. env.Install( env['LIBDIR'], [clientlib, serverlib])
  139. if not env['FULL_MIMIC']:
  140. wrapperlib = env.SharedLibrary(env['WRAPPERLIB'], srcfiles_common_wrapperlib)
  141. env.Install( env['LIBDIR'], [wrapperlib])
  142. env.Alias('install', env['LIBDIR'])
  143. # Handle the way we name libraries on a POSIX system
  144. # 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
  145. if env['PLATFORM'] == 'posix':
  146. libs = [(env['CLIENTLIB'], clientlib), (env['SERVERLIB'], serverlib)]
  147. if not env['FULL_MIMIC']:
  148. libs.append((env['WRAPPERLIB'], wrapperlib))
  149. for lib_name, lib in libs:
  150. env.Command('#/common/lib' + lib_name + '.so.0', lib, symlinkcmd)
  151. env.Command('#/common/lib' + lib_name + '.so', '#/common/lib'+lib_name+'.so.0', symlinkcmd)
  152. env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so.0', env['LIBDIR'] + '/lib' + lib_name + '.so.0.0', symlinkcmd)
  153. env.Command(env['LIBDIR'] + '/lib' + lib_name + '.so', env['LIBDIR'] + '/lib' + lib_name + '.so.0', symlinkcmd)
  154. env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so.0')
  155. env.Alias('install', env['LIBDIR'] + '/lib' + lib_name + '.so')
  156. # Headers
  157. for header in jack_headers:
  158. env.Install(env['INCLUDEDIR'] + '/jack', 'jack/' + header)
  159. env.Alias('install', env['INCLUDEDIR'])