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.

197 lines
6.3KB

  1. #
  2. # Copyright (C) 2007 Arnold Krille
  3. # Copyright (C) 2007 Pieter Palmers
  4. #
  5. # This file originally was part of FFADO
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. import os
  21. import glob
  22. from string import Template
  23. Import( 'env' )
  24. # paths where include files can be found
  25. env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack"] )
  26. # HACK: this should not be here ideally
  27. env.AppendUnique( CPPPATH=["#/linux","#/macosx"] )
  28. # a symlinking command
  29. symlinkcmd = 'cd $TARGET.dir && rm -f -v $TARGET.name && ln -v -s $SOURCE.name $TARGET.name'
  30. #
  31. # Define the source files
  32. #
  33. srcfiles_common_serverlib = [
  34. 'JackActivationCount.cpp',
  35. 'JackAPI.cpp',
  36. 'JackAudioDriver.cpp',
  37. 'JackClient.cpp',
  38. 'JackConnectionManager.cpp',
  39. 'JackDriver.cpp',
  40. 'JackEngine.cpp',
  41. 'JackEngineControl.cpp',
  42. 'JackError.c',
  43. 'JackExternalClient.cpp',
  44. 'JackFrameTimer.cpp',
  45. 'JackFreewheelDriver.cpp',
  46. 'JackGlobalsServer.cpp',
  47. 'JackGraphManager.cpp',
  48. 'JackInternalClient.cpp',
  49. 'JackPort.cpp',
  50. 'JackPosixSemaphore.cpp',
  51. 'JackPosixThread.cpp',
  52. 'JackFifo.cpp',
  53. 'JackLoopbackDriver.cpp',
  54. 'JackPortType.cpp',
  55. 'JackAudioPort.cpp',
  56. 'JackMidiPort.cpp',
  57. 'JackMidiAPI.cpp',
  58. 'JackServer.cpp',
  59. 'JackShmMem.cpp',
  60. 'JackThreadedDriver.cpp',
  61. 'shm.c',
  62. 'JackSocket.cpp',
  63. 'JackSocketServerChannel.cpp',
  64. 'JackSocketNotifyChannel.cpp',
  65. 'JackSocketServerNotifyChannel.cpp',
  66. 'JackTime.c',
  67. 'JackServerAPI.cpp',
  68. 'JackGlobals.cpp',
  69. 'JackDriverLoader.cpp',
  70. 'JackDebugClient.cpp',
  71. 'JackTransportEngine.cpp',
  72. 'JackServerGlobals.cpp',
  73. 'JackServerLaunch.cpp',
  74. 'timestamps.c',
  75. 'JackTools.cpp',
  76. 'ringbuffer.c'
  77. ]
  78. srcfiles_common_clientlib = [
  79. 'JackActivationCount.cpp',
  80. 'JackAPI.cpp',
  81. 'JackClient.cpp',
  82. 'JackConnectionManager.cpp',
  83. 'ringbuffer.c',
  84. 'JackServerLaunch.cpp',
  85. 'JackError.c',
  86. 'JackFrameTimer.cpp',
  87. 'JackGlobalsClient.cpp',
  88. 'JackGraphManager.cpp',
  89. 'JackLibClient.cpp',
  90. 'JackLibAPI.cpp',
  91. 'JackPort.cpp',
  92. 'JackPosixSemaphore.cpp',
  93. 'JackFifo.cpp',
  94. 'JackPortType.cpp',
  95. 'JackAudioPort.cpp',
  96. 'JackMidiPort.cpp',
  97. 'JackMidiAPI.cpp',
  98. 'JackEngineControl.cpp',
  99. 'JackPosixThread.cpp',
  100. 'JackShmMem.cpp',
  101. 'shm.c',
  102. 'JackSocket.cpp',
  103. 'JackSocketClientChannel.cpp',
  104. 'JackTime.c',
  105. 'JackGlobals.cpp',
  106. 'JackDebugClient.cpp',
  107. 'JackTransportEngine.cpp',
  108. 'timestamps.c',
  109. 'JackTools.cpp'
  110. ]
  111. srcfiles_common_wrapperlib = [
  112. 'JackAPIWrapper.cpp',
  113. 'ringbuffer.c'
  114. ]
  115. jack_headers = [
  116. 'intclient.h',
  117. 'jack.h',
  118. 'midiport.h',
  119. 'ringbuffer.h',
  120. 'statistics.h',
  121. 'thread.h',
  122. 'transport.h',
  123. 'types.h'
  124. ]
  125. #
  126. # Start building
  127. #
  128. env.AppendUnique( LIBS=["rt", "pthread"] )
  129. # build the common stuff
  130. if env['PLATFORM'] == 'posix':
  131. env.AppendUnique( SHLIBSUFFIX=".0.0" )
  132. clientlib_name = "jackmp"
  133. serverlib_name = "jackservermp"
  134. wrapperlib_name = "jackwrapper"
  135. clientlib = env.SharedLibrary( clientlib_name, srcfiles_common_clientlib )
  136. serverlib = env.SharedLibrary( serverlib_name, srcfiles_common_serverlib )
  137. wrapperlib = env.SharedLibrary( wrapperlib_name, srcfiles_common_wrapperlib )
  138. env.Install( env['libdir'], [clientlib, serverlib, wrapperlib])
  139. env.Alias("install", env['libdir'])
  140. if env['PLATFORM'] == 'posix':
  141. for lib_name, lib in [(clientlib_name, clientlib), (serverlib_name, serverlib), (wrapperlib_name, wrapperlib)]:
  142. env.Command('lib' + lib_name + '.so.0', lib, symlinkcmd)
  143. env.Command('lib' + lib_name + '.so', 'lib'+lib_name+'.so.0', symlinkcmd)
  144. env.Command(env['libdir'] + '/lib' + lib_name + '.so.0', env['libdir'] + '/lib' + lib_name + '.so.0.0', symlinkcmd)
  145. env.Command(env['libdir'] + '/lib' + lib_name + '.so', env['libdir'] + '/lib' + lib_name + '.so.0', symlinkcmd)
  146. env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so.0')
  147. env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so')
  148. # install the headers
  149. for header in jack_headers:
  150. env.Install(env['includedir'] + '/jack', 'jack/' + header)
  151. env.Alias("install", env['includedir'])
  152. #if env['JACK_FLAGS']:
  153. #jack_include_dir = env['JACK_INCLUDEDIR']
  154. #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_include_dir ):
  155. #if env.GetOption('clean'):
  156. #pass
  157. #else:
  158. #jack_old_includes_dir = env['includedir'] + '/jack_up'
  159. #print "moving old jack includes to %s..." % jack_old_includes_dir
  160. #env.Command(jack_old_includes_dir, jack_include_dir, Move("$TARGET", "$SOURCE"))
  161. # install the libs
  162. #jack_libdir = env['JACK_LIBDIR']
  163. #libjackdmp_location = env['libdir'] + '/libjackmp.so'
  164. #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_libdir ):
  165. #if env.GetOption('clean'):
  166. #note: is this executed before the actual uninstall?
  167. #lib_files = glob.glob(jack_libdir + '/libjack.so.*.up')
  168. #for old_name in lib_files:
  169. #new_name = old_name[:-3]
  170. #print "restoring old jack lib %s to %s..." % (old_name, new_name)
  171. #env.Command(Delete(new_name))
  172. #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE"))
  173. #else:
  174. #lib_files = glob.glob(jack_libdir + '/libjack.so.*')
  175. #env.Alias("install", env.Install(env['libdir'], serverlib))
  176. #env.Alias("install", env.Install(env['libdir'], clientlib))
  177. #for old_name in lib_files:
  178. #new_name = old_name + '.up'
  179. #print "moving old jack lib %s to %s..." % (old_name, new_name)
  180. #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE"))
  181. #print " linking to %s..." % (libjackdmp_location)
  182. #env.Command(old_name, libjackdmp_location, "ln -s $TARGET $SOURCE")