xlc.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2006-2018 (ita)
  4. # Ralf Habacker, 2006 (rh)
  5. # Yinon Ehrlich, 2009
  6. # Michael Kuhn, 2009
  7. from waflib.Tools import ccroot, ar
  8. from waflib.Configure import conf
  9. @conf
  10. def find_xlc(conf):
  11. """
  12. Detects the Aix C compiler
  13. """
  14. cc = conf.find_program(['xlc_r', 'xlc'], var='CC')
  15. conf.get_xlc_version(cc)
  16. conf.env.CC_NAME = 'xlc'
  17. @conf
  18. def xlc_common_flags(conf):
  19. """
  20. Flags required for executing the Aix C compiler
  21. """
  22. v = conf.env
  23. v.CC_SRC_F = []
  24. v.CC_TGT_F = ['-c', '-o']
  25. if not v.LINK_CC:
  26. v.LINK_CC = v.CC
  27. v.CCLNK_SRC_F = []
  28. v.CCLNK_TGT_F = ['-o']
  29. v.CPPPATH_ST = '-I%s'
  30. v.DEFINES_ST = '-D%s'
  31. v.LIB_ST = '-l%s' # template for adding libs
  32. v.LIBPATH_ST = '-L%s' # template for adding libpaths
  33. v.STLIB_ST = '-l%s'
  34. v.STLIBPATH_ST = '-L%s'
  35. v.RPATH_ST = '-Wl,-rpath,%s'
  36. v.SONAME_ST = []
  37. v.SHLIB_MARKER = []
  38. v.STLIB_MARKER = []
  39. v.LINKFLAGS_cprogram = ['-Wl,-brtl']
  40. v.cprogram_PATTERN = '%s'
  41. v.CFLAGS_cshlib = ['-fPIC']
  42. v.LINKFLAGS_cshlib = ['-G', '-Wl,-brtl,-bexpfull']
  43. v.cshlib_PATTERN = 'lib%s.so'
  44. v.LINKFLAGS_cstlib = []
  45. v.cstlib_PATTERN = 'lib%s.a'
  46. def configure(conf):
  47. conf.find_xlc()
  48. conf.find_ar()
  49. conf.xlc_common_flags()
  50. conf.cc_load_tools()
  51. conf.cc_add_flags()
  52. conf.link_add_flags()