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.

60 lines
1.2KB

  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Alex Rønne Petersen, 2012 (alexrp/Zor)
  4. import sys
  5. from waflib.Tools import ar, d
  6. from waflib.Configure import conf
  7. @conf
  8. def find_ldc2(conf):
  9. """
  10. Find the program *ldc2* and set the variable *D*
  11. """
  12. conf.find_program(['ldc2'], var='D')
  13. out = conf.cmd_and_log(conf.env.D + ['-version'])
  14. if out.find("based on DMD v2.") == -1:
  15. conf.fatal("detected compiler is not ldc2")
  16. @conf
  17. def common_flags_ldc2(conf):
  18. """
  19. Set the D flags required by *ldc2*
  20. """
  21. v = conf.env
  22. v['D_SRC_F'] = ['-c']
  23. v['D_TGT_F'] = '-of%s'
  24. v['D_LINKER'] = v['D']
  25. v['DLNK_SRC_F'] = ''
  26. v['DLNK_TGT_F'] = '-of%s'
  27. v['DINC_ST'] = '-I%s'
  28. v['DSHLIB_MARKER'] = v['DSTLIB_MARKER'] = ''
  29. v['DSTLIB_ST'] = v['DSHLIB_ST'] = '-L-l%s'
  30. v['DSTLIBPATH_ST'] = v['DLIBPATH_ST'] = '-L-L%s'
  31. v['LINKFLAGS_dshlib'] = ['-L-shared']
  32. v['DHEADER_ext'] = '.di'
  33. v['DFLAGS_d_with_header'] = ['-H', '-Hf']
  34. v['D_HDR_F'] = '%s'
  35. v['LINKFLAGS'] = []
  36. v['DFLAGS_dshlib'] = ['-relocation-model=pic']
  37. def configure(conf):
  38. """
  39. Configuration for *ldc2*
  40. """
  41. conf.find_ldc2()
  42. conf.load('ar')
  43. conf.load('d')
  44. conf.common_flags_ldc2()
  45. conf.d_platform_flags()