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.

91 lines
2.7KB

  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. import Params
  4. import commands
  5. import Params
  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. def configure(conf):
  39. conf.check_tool('compiler_cxx')
  40. conf.check_tool('compiler_cc')
  41. conf.sub_config('linux')
  42. if Params.g_options.dbus:
  43. conf.sub_config('linux/dbus')
  44. conf.sub_config('example-clients')
  45. conf.env['LIB_PTHREAD'] = ['pthread']
  46. conf.env['LIB_DL'] = ['dl']
  47. conf.env['LIB_RT'] = ['rt']
  48. conf.env['JACK_API_VERSION'] = JACK_API_VERSION
  49. conf.define('ADDON_DIR', conf.env['PREFIX'] + '/lib/jack')
  50. conf.define('JACK_LOCATION', conf.env['PREFIX'] + '/bin')
  51. conf.define('SOCKET_RPC_FIFO_SEMA', 1)
  52. conf.define('__SMP__', 1)
  53. conf.define('USE_POSIX_SHM', 1)
  54. conf.define('JACK_SVNREVISION', fetch_svn_revision('.'))
  55. conf.define('JACKMP', 1)
  56. if conf.env['BUILD_JACKDBUS'] == True:
  57. conf.define('JACK_DBUS', 1)
  58. conf.write_config_header('config.h')
  59. display_msg("\n==================")
  60. display_msg("JACK %s %s" % (VERSION, conf.get_define('JACK_SVNREVISION')))
  61. print
  62. display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
  63. display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN')
  64. display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True)
  65. display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)
  66. display_feature('Build with FireWire (FFADO) support', conf.env['BUILD_DRIVER_FFADO'] == True)
  67. display_feature('Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'] == True)
  68. print
  69. def build(bld):
  70. # process subfolders from here
  71. bld.add_subdirs('common')
  72. bld.add_subdirs('linux')
  73. if bld.env()['BUILD_JACKDBUS'] == True:
  74. bld.add_subdirs('linux/dbus')
  75. bld.add_subdirs('example-clients')
  76. bld.add_subdirs('tests')