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.

61 lines
1.2KB

  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Carlos Rafael Giani, 2007 (dv)
  4. import sys
  5. from waflib.Tools import ar, d
  6. from waflib.Configure import conf
  7. @conf
  8. def find_gdc(conf):
  9. """
  10. Find the program gdc and set the variable *D*
  11. """
  12. conf.find_program('gdc', var='D')
  13. out = conf.cmd_and_log(conf.env.D + ['--version'])
  14. if out.find("gdc") == -1:
  15. conf.fatal("detected compiler is not gdc")
  16. @conf
  17. def common_flags_gdc(conf):
  18. """
  19. Set the flags required by *gdc*
  20. """
  21. v = conf.env
  22. # _DFLAGS _DIMPORTFLAGS
  23. # for mory info about the meaning of this dict see dmd.py
  24. v['DFLAGS'] = []
  25. v['D_SRC_F'] = ['-c']
  26. v['D_TGT_F'] = '-o%s'
  27. # linker
  28. v['D_LINKER'] = v['D']
  29. v['DLNK_SRC_F'] = ''
  30. v['DLNK_TGT_F'] = '-o%s'
  31. v['DINC_ST'] = '-I%s'
  32. v['DSHLIB_MARKER'] = v['DSTLIB_MARKER'] = ''
  33. v['DSTLIB_ST'] = v['DSHLIB_ST'] = '-l%s'
  34. v['DSTLIBPATH_ST'] = v['DLIBPATH_ST'] = '-L%s'
  35. v['LINKFLAGS_dshlib'] = ['-shared']
  36. v['DHEADER_ext'] = '.di'
  37. v.DFLAGS_d_with_header = '-fintfc'
  38. v['D_HDR_F'] = '-fintfc-file=%s'
  39. def configure(conf):
  40. """
  41. Configuration for gdc
  42. """
  43. conf.find_gdc()
  44. conf.load('ar')
  45. conf.load('d')
  46. conf.common_flags_gdc()
  47. conf.d_platform_flags()