Non reinvents the DAW. Powerful enough to form a complete studio, fast and light enough to run on low-end hardware like the eeePC or Raspberry Pi, and so reliable that it can be used live https://non.tuxfamily.org/
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.

121 lines
3.5KB

  1. #!/usr/bin/env python
  2. import os
  3. import subprocess
  4. import waflib.Logs as Logs, waflib.Options as Options
  5. import string
  6. VERSION = 'xxx'
  7. APPNAME = 'non-things'
  8. top = '.'
  9. out = 'build'
  10. common = [ 'nonlib', 'FL' ]
  11. projects = [ 'timeline', 'mixer', 'sequencer', 'session-manager' ]
  12. def options(opt):
  13. # opt.add_option('--use-system-ntk', action='store_true', default=False,
  14. # dest='use_system_ntk',
  15. # help="Link to system-installed shared NTK instead of bundled version")
  16. opt.add_option('--enable-debug', action='store_true', default=False, dest='debug',
  17. help='Build for debugging')
  18. opt.add_option('--project', action='store', default=False, dest='project',
  19. help='Limit build to a single project (' + string.join( projects, ', ' ) + ')')
  20. for i in projects:
  21. opt.recurse(i)
  22. def configure(conf):
  23. conf.load('compiler_c')
  24. conf.load('compiler_cxx')
  25. conf.load('gnu_dirs')
  26. conf.load('ntk_fluid')
  27. conf.line_just = 52
  28. optimization_flags = [
  29. "-O3",
  30. "-fomit-frame-pointer",
  31. "-ffast-math",
  32. # "-fstrength-reduce",
  33. "-pipe"
  34. ]
  35. debug_flags = [ '-g' ]
  36. if Options.options.debug:
  37. conf.env.append_value('CFLAGS', debug_flags )
  38. conf.env.append_value('CXXFLAGS', debug_flags )
  39. else:
  40. conf.env.append_value('CFLAGS', optimization_flags )
  41. conf.env.append_value('CXXFLAGS', optimization_flags )
  42. conf.define( 'NDEBUG', 1 )
  43. conf.env.append_value('CFLAGS',['-Wall'])
  44. # conf.env.append_value('CXXFLAGS',['-Wall','-fno-exceptions', '-fno-rtti'])
  45. conf.env.append_value('CXXFLAGS',['-Wall','-fno-rtti'])
  46. # NTK_EXTRA_FLAGS=''
  47. # if not Options.options.use_system_ntk:
  48. # print 'Using bundled NTK'
  49. # os.environ['PKG_CONFIG_PATH'] = 'lib/ntk/build/:' + os.environ.get('PKG_CONFIG_PATH','')
  50. # NTK_EXTRA_FLAGS='--static'
  51. # PWD = os.environ.get('PWD','')
  52. # os.environ['PATH'] = PWD + '/lib/ntk/build/fluid:' + os.environ.get('PATH','')
  53. conf.check_cfg(package='ntk', uselib_store='NTK', args='--cflags --libs',
  54. atleast_version='1.3.0', mandatory=True)
  55. conf.check_cfg(package='ntk_images', uselib_store='NTK_IMAGES', args=' --cflags --libs',
  56. atleast_version='1.3.0', mandatory=True)
  57. conf.find_program('ntk-fluid', var='NTK_FLUID')
  58. conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs",
  59. atleast_version='0.103.0', mandatory=True)
  60. conf.check_cfg(package='xpm', uselib_store='XMP',args="--cflags --libs",
  61. atleast_version='2.0.0', mandatory=True)
  62. conf.check_cfg(package='liblo', uselib_store='LIBLO',args="--cflags --libs",
  63. atleast_version='0.26', mandatory=True)
  64. ###
  65. for i in common:
  66. conf.recurse(i)
  67. conf.env.PROJECT = conf.options.project
  68. if conf.env.PROJECT:
  69. pl = [ conf.env.PROJECT ]
  70. else:
  71. pl = projects;
  72. for i in pl:
  73. Logs.pprint('YELLOW', 'Configuring %s' % i)
  74. conf.recurse(i);
  75. def run(ctx):
  76. if not Options.options.cmd:
  77. Logs.error("missing --cmd option for run command")
  78. return
  79. cmd = Options.options.cmd
  80. Logs.pprint('GREEN', 'Running %s' % cmd)
  81. subprocess.call(cmd, shell=True, env=source_tree_env())
  82. def build(bld):
  83. for i in common:
  84. bld.recurse(i)
  85. if bld.env.PROJECT:
  86. pl = [ bld.env.PROJECT ]
  87. else:
  88. pl = projects;
  89. for i in pl:
  90. bld.recurse(i);