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.

109 lines
3.9KB

  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. import os
  4. import Params
  5. import commands
  6. from Configure import g_maxlen
  7. #g_maxlen = 40
  8. VERSION='1.9.0'
  9. APPNAME='jack'
  10. JACK_API_VERSION = '0.1.0'
  11. # these variables are mandatory ('/' are converted automatically)
  12. srcdir = '.'
  13. blddir = 'build'
  14. def display_msg(msg, status = None, color = None):
  15. sr = msg
  16. global g_maxlen
  17. g_maxlen = max(g_maxlen, len(msg))
  18. if status:
  19. print "%s :" % msg.ljust(g_maxlen),
  20. Params.pprint(color, status)
  21. else:
  22. print "%s" % msg.ljust(g_maxlen)
  23. def display_feature(msg, build):
  24. if build:
  25. display_msg(msg, "yes", 'GREEN')
  26. else:
  27. display_msg(msg, "no", 'YELLOW')
  28. def fetch_svn_revision(path):
  29. cmd = "LANG= "
  30. cmd += "svnversion "
  31. cmd += path
  32. return commands.getoutput(cmd)
  33. def set_options(opt):
  34. # options provided by the modules
  35. opt.tool_options('compiler_cxx')
  36. opt.tool_options('compiler_cc')
  37. opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)')
  38. opt.sub_options('linux/dbus')
  39. def configure(conf):
  40. conf.check_tool('compiler_cxx')
  41. conf.check_tool('compiler_cc')
  42. conf.sub_config('linux')
  43. if Params.g_options.dbus:
  44. conf.sub_config('linux/dbus')
  45. conf.sub_config('example-clients')
  46. conf.env['LIB_PTHREAD'] = ['pthread']
  47. conf.env['LIB_DL'] = ['dl']
  48. conf.env['LIB_RT'] = ['rt']
  49. conf.env['JACK_API_VERSION'] = JACK_API_VERSION
  50. conf.env['JACK_VERSION'] = VERSION
  51. conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack'))
  52. conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin'))
  53. conf.define('SOCKET_RPC_FIFO_SEMA', 1)
  54. conf.define('__SMP__', 1)
  55. conf.define('USE_POSIX_SHM', 1)
  56. conf.define('JACK_SVNREVISION', fetch_svn_revision('.'))
  57. conf.define('JACKMP', 1)
  58. if conf.env['BUILD_JACKDBUS'] == True:
  59. conf.define('JACK_DBUS', 1)
  60. conf.write_config_header('config.h')
  61. display_msg("\n==================")
  62. display_msg("JACK %s %s" % (VERSION, conf.get_define('JACK_SVNREVISION')))
  63. print
  64. display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
  65. display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN')
  66. display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True)
  67. display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)
  68. display_feature('Build with FireWire (FFADO) support', conf.env['BUILD_DRIVER_FFADO'] == True)
  69. display_feature('Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'] == True)
  70. if conf.env['BUILD_JACKDBUS'] == True:
  71. display_msg('D-Bus service install directory', conf.env['DBUS_SERVICES_DIR'], 'CYAN')
  72. #display_msg('Settings persistence', xxx)
  73. if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0]:
  74. print
  75. print Params.g_colors['RED'] + "WARNING: D-Bus session services directory as reported by pkg-config is"
  76. print Params.g_colors['RED'] + "WARNING:",
  77. print Params.g_colors['CYAN'] + conf.env['DBUS-1_SESSION_BUS_SERVICES_DIR'][0]
  78. print Params.g_colors['RED'] + 'WARNING: but service file will be installed in'
  79. print Params.g_colors['RED'] + "WARNING:",
  80. print Params.g_colors['CYAN'] + conf.env['DBUS_SERVICES_DIR']
  81. print Params.g_colors['RED'] + 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus'
  82. print 'WARNING: You can override dbus service install directory'
  83. print 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script'
  84. print Params.g_colors['NORMAL'],
  85. print
  86. def build(bld):
  87. # process subfolders from here
  88. bld.add_subdirs('common')
  89. bld.add_subdirs('linux')
  90. if bld.env()['BUILD_JACKDBUS'] == True:
  91. bld.add_subdirs('linux/dbus')
  92. bld.add_subdirs('example-clients')
  93. bld.add_subdirs('tests')