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.

127 lines
4.4KB

  1. #! /usr/bin/python3
  2. # encoding: utf-8
  3. #
  4. # Copyright (C) 2015, 2017-2018 Karl Linden <karl.j.linden@gmail.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #
  19. example_programs = {
  20. 'jack_cpu_load': 'cpu_load.c',
  21. 'jack_latent_client': 'latent_client.c',
  22. 'jack_metro': 'metro.c',
  23. 'jack_midi_latency_test': 'midi_latency_test.c',
  24. 'jack_midiseq': 'midiseq.c',
  25. 'jack_midisine': 'midisine.c',
  26. 'jack_net_master': 'netmaster.c',
  27. 'jack_net_slave': 'netslave.c',
  28. 'jack_server_control': 'server_control.cpp',
  29. 'jack_showtime': 'showtime.c',
  30. 'jack_simdtests': 'simdtests.cpp',
  31. 'jack_simple_client': 'simple_client.c',
  32. 'jack_simple_session_client': 'simple_session_client.c',
  33. 'jack_thru': 'thru_client.c',
  34. 'jack_zombie': 'zombie.c',
  35. }
  36. example_libs = {
  37. 'inprocess': 'inprocess.c',
  38. }
  39. def configure(conf):
  40. conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.env['SNDFILE']
  41. def build(bld):
  42. if bld.env['IS_LINUX']:
  43. os_incdir = ['../linux', '../posix']
  44. if bld.env['IS_MACOSX']:
  45. os_incdir = ['../macosx', '../posix']
  46. if bld.env['IS_FREEBSD']:
  47. os_incdir = ['../freebsd', '../posix']
  48. if bld.env['IS_SUN']:
  49. os_incdir = ['../solaris', '../posix']
  50. if bld.env['IS_WINDOWS']:
  51. os_incdir = ['../windows']
  52. for example_program, example_program_source in list(example_programs.items()):
  53. if example_program == 'jack_server_control':
  54. use = ['serverlib', 'STDC++']
  55. elif example_program == 'jack_net_slave':
  56. if not bld.env['BUILD_NETLIB']:
  57. continue
  58. use = ['netlib']
  59. elif example_program == 'jack_net_master':
  60. if not bld.env['BUILD_NETLIB']:
  61. continue
  62. use = ['netlib']
  63. else:
  64. use = ['clientlib']
  65. if example_program == 'jack_simdtests':
  66. ftrs = 'cxx cxxprogram'
  67. else:
  68. ftrs = 'c cprogram'
  69. if bld.env['IS_MACOSX']:
  70. prog = bld(features=ftrs, framework=['Foundation'])
  71. else:
  72. prog = bld(features=ftrs)
  73. prog.includes = os_incdir + ['../common/jack', '../common']
  74. prog.source = example_program_source
  75. prog.use = use
  76. if bld.env['IS_LINUX']:
  77. prog.use += ['RT', 'M']
  78. if bld.env['IS_SUN']:
  79. prog.use += ['M']
  80. if bld.env['IS_FREEBSD']:
  81. prog.use += ['M']
  82. if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']:
  83. prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
  84. prog.target = example_program
  85. if bld.env['BUILD_EXAMPLE_CLIENT_REC']:
  86. prog = bld(features='c cprogram')
  87. prog.includes = os_incdir + ['../common/jack', '../common']
  88. prog.source = 'capture_client.c'
  89. prog.use = ['clientlib']
  90. if bld.env['IS_MACOSX']:
  91. prog.use += ['SNDFILE']
  92. if bld.env['IS_LINUX']:
  93. prog.use += ['RT', 'SNDFILE']
  94. if bld.env['IS_FREEBSD']:
  95. prog.use += ['SNDFILE']
  96. if bld.env['IS_SUN']:
  97. prog.use += ['RT', 'SNDFILE']
  98. if bld.env['IS_WINDOWS']:
  99. prog.uselib = ['SNDFILE']
  100. if bld.env['BUILD_STATIC']:
  101. prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
  102. prog.target = 'jack_rec'
  103. for example_lib, example_lib_source in list(example_libs.items()):
  104. lib = bld(features='c cshlib')
  105. if not bld.env['IS_WINDOWS']:
  106. lib.env['cshlib_PATTERN'] = '%s.so'
  107. lib.includes = os_incdir + ['../common/jack', '../common']
  108. lib.target = example_lib
  109. lib.source = example_lib_source
  110. if bld.env['IS_SUN']:
  111. lib.env.append_value('LINKFLAGS', '-lm')
  112. if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']:
  113. prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
  114. lib.use = 'serverlib'
  115. lib.install_path = '${ADDON_DIR}/'