irixcc.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # imported from samba
  4. """
  5. Compiler definition for irix/MIPSpro cc compiler
  6. """
  7. from waflib import Errors
  8. from waflib.Tools import ccroot, ar
  9. from waflib.Configure import conf
  10. @conf
  11. def find_irixcc(conf):
  12. v = conf.env
  13. cc = None
  14. if v.CC:
  15. cc = v.CC
  16. elif 'CC' in conf.environ:
  17. cc = conf.environ['CC']
  18. if not cc:
  19. cc = conf.find_program('cc', var='CC')
  20. if not cc:
  21. conf.fatal('irixcc was not found')
  22. try:
  23. conf.cmd_and_log(cc + ['-version'])
  24. except Errors.WafError:
  25. conf.fatal('%r -version could not be executed' % cc)
  26. v.CC = cc
  27. v.CC_NAME = 'irix'
  28. @conf
  29. def irixcc_common_flags(conf):
  30. v = conf.env
  31. v.CC_SRC_F = ''
  32. v.CC_TGT_F = ['-c', '-o']
  33. v.CPPPATH_ST = '-I%s'
  34. v.DEFINES_ST = '-D%s'
  35. if not v.LINK_CC:
  36. v.LINK_CC = v.CC
  37. v.CCLNK_SRC_F = ''
  38. v.CCLNK_TGT_F = ['-o']
  39. v.LIB_ST = '-l%s' # template for adding libs
  40. v.LIBPATH_ST = '-L%s' # template for adding libpaths
  41. v.STLIB_ST = '-l%s'
  42. v.STLIBPATH_ST = '-L%s'
  43. v.cprogram_PATTERN = '%s'
  44. v.cshlib_PATTERN = 'lib%s.so'
  45. v.cstlib_PATTERN = 'lib%s.a'
  46. def configure(conf):
  47. conf.find_irixcc()
  48. conf.find_cpp()
  49. conf.find_ar()
  50. conf.irixcc_common_flags()
  51. conf.cc_load_tools()
  52. conf.cc_add_flags()
  53. conf.link_add_flags()