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.

116 lines
5.0KB

  1. #! /usr/bin/python3
  2. # encoding: utf-8
  3. example_tools = {
  4. 'jack_alias' : 'alias.c',
  5. 'jack_bufsize' : 'bufsize.c',
  6. 'jack_connect' : 'connect.c',
  7. 'jack_evmon' : 'evmon.c',
  8. 'jack_freewheel' : 'freewheel.c',
  9. 'jack_load' : 'ipload.c',
  10. 'jack_lsp' : 'lsp.c',
  11. 'jack_midi_dump' : 'midi_dump.c',
  12. 'jack_monitor_client' : 'monitor_client.c',
  13. 'jack_property' : 'property.c',
  14. 'jack_samplerate' : 'samplerate.c',
  15. 'jack_session_notify' : 'session_notify.c',
  16. 'jack_unload' : 'ipunload.c',
  17. 'jack_wait' : 'wait.c',
  18. }
  19. def configure(conf):
  20. conf.env['BUILD_TOOL_ALSA_IO'] = conf.env['SAMPLERATE'] and conf.env['BUILD_DRIVER_ALSA']
  21. conf.env['BUILD_TOOL_CLIENT_TRANSPORT'] = conf.env['READLINE']
  22. conf.env['BUILD_TOOL_CLIENT_NETSOURCE'] = conf.env['CELT'] or conf.env['OPUS']
  23. conf.env['BUILD_TOOL_ZALSA'] = conf.env['ZALSA']
  24. def build(bld):
  25. if bld.env['IS_LINUX']:
  26. os_incdir = ['../linux', '../posix']
  27. if bld.env['IS_MACOSX']:
  28. os_incdir = ['../macosx', '../posix']
  29. if bld.env['IS_SUN']:
  30. os_incdir = ['../solaris', '../posix']
  31. if bld.env['IS_WINDOWS']:
  32. os_incdir = ['../windows']
  33. for example_tool, example_tool_source in list(example_tools.items()):
  34. if bld.env['IS_MACOSX']:
  35. prog = bld(features='c cprogram', framework = ['Foundation'])
  36. else:
  37. prog = bld(features='c cprogram')
  38. prog.includes = os_incdir + ['../common/jack', '../common']
  39. prog.source = example_tool_source
  40. prog.use = ['clientlib']
  41. if bld.env['IS_LINUX']:
  42. prog.use += ['RT', 'M']
  43. if bld.env['IS_SUN']:
  44. prog.use += ['M']
  45. if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']:
  46. prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
  47. #prog.cflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation']
  48. #prog.cxxflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation']
  49. prog.target = example_tool
  50. if bld.env['BUILD_TOOL_CLIENT_TRANSPORT']:
  51. prog = bld(features = 'c cprogram')
  52. prog.includes = os_incdir + ['../common/jack', '../common']
  53. prog.source = 'transport.c'
  54. prog.use = ['clientlib']
  55. if bld.env['IS_LINUX']:
  56. prog.use += ['RT', 'READLINE']
  57. if bld.env['IS_MACOSX']:
  58. prog.use += ['READLINE']
  59. if bld.env['IS_WINDOWS']:
  60. prog.use += ['READLINE']
  61. if bld.env['BUILD_STATIC']:
  62. prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
  63. prog.target = 'jack_transport'
  64. if bld.env['BUILD_TOOL_CLIENT_NETSOURCE']:
  65. prog = bld(features = 'c cprogram')
  66. prog.includes = os_incdir + ['.', '..', '../common/jack', '../common']
  67. prog.source = ['netsource.c', '../common/netjack_packet.c']
  68. prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
  69. prog.use = ['CELT', 'SAMPLERATE', 'OPUS', 'M', 'clientlib']
  70. prog.target = 'jack_netsource'
  71. prog.defines = ['HAVE_CONFIG_H']
  72. if bld.env['IS_LINUX'] and bld.env['BUILD_TOOL_ALSA_IO']:
  73. prog = bld(features = 'c cprogram')
  74. prog.includes = os_incdir + ['../common/jack', '../common']
  75. prog.source = ['alsa_in.c', '../common/memops.c']
  76. prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
  77. prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
  78. prog.target = 'alsa_in'
  79. prog = bld(features = 'c cprogram')
  80. prog.includes = os_incdir + ['../common/jack', '../common']
  81. prog.source = ['alsa_out.c', '../common/memops.c']
  82. prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR')
  83. prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
  84. prog.target = 'alsa_out'
  85. if bld.env['IS_LINUX'] and bld.env['BUILD_TOOL_ZALSA']:
  86. prog = bld(features = ['cxx', 'cxxshlib'])
  87. prog.defines = ['HAVE_CONFIG_H','SERVER_SIDE','APPNAME="zalsa_in"','VERSION="0.4.0"']
  88. prog.install_path = '${ADDON_DIR}/'
  89. prog.includes = os_incdir + ['../common/jack', '../common', 'zalsa']
  90. prog.source = ['zalsa/zita-a2j.cc', 'zalsa/alsathread.cc', 'zalsa/jackclient.cc', 'zalsa/pxthread.cc', 'zalsa/lfqueue.cc']
  91. prog.target = 'zalsa_in'
  92. prog.use = ['ZITA-ALSA-PCMI', 'ZITA-RESAMPLER', 'ALSA', 'M', 'RT', 'serverlib']
  93. prog.env['cxxshlib_PATTERN'] = '%s.so'
  94. prog = bld(features = ['cxx', 'cxxshlib'])
  95. prog.defines = ['HAVE_CONFIG_H','SERVER_SIDE','APPNAME="zalsa_out"','VERSION="0.4.0"']
  96. prog.install_path = '${ADDON_DIR}/'
  97. prog.includes = os_incdir + ['../common/jack', '../common', 'zalsa']
  98. prog.source = ['zalsa/zita-j2a.cc', 'zalsa/alsathread.cc', 'zalsa/jackclient.cc', 'zalsa/pxthread.cc', 'zalsa/lfqueue.cc']
  99. prog.target = 'zalsa_out'
  100. prog.use = ['ZITA-ALSA-PCMI', 'ZITA-RESAMPLER', 'ALSA', 'M', 'RT', 'serverlib']
  101. prog.env['cxxshlib_PATTERN'] = '%s.so'
  102. if not bld.env['IS_WINDOWS']:
  103. bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
  104. bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)