xlcxx.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_xlcxx(conf):
  11. """
  12. Detects the Aix C++ compiler
  13. """
  14. cxx = conf.find_program(['xlc++_r', 'xlc++'], var='CXX')
  15. conf.get_xlc_version(cxx)
  16. conf.env.CXX_NAME = 'xlc++'
  17. @conf
  18. def xlcxx_common_flags(conf):
  19. """
  20. Flags required for executing the Aix C++ compiler
  21. """
  22. v = conf.env
  23. v.CXX_SRC_F = []
  24. v.CXX_TGT_F = ['-c', '-o']
  25. if not v.LINK_CXX:
  26. v.LINK_CXX = v.CXX
  27. v.CXXLNK_SRC_F = []
  28. v.CXXLNK_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_cxxprogram= ['-Wl,-brtl']
  40. v.cxxprogram_PATTERN = '%s'
  41. v.CXXFLAGS_cxxshlib = ['-fPIC']
  42. v.LINKFLAGS_cxxshlib = ['-G', '-Wl,-brtl,-bexpfull']
  43. v.cxxshlib_PATTERN = 'lib%s.so'
  44. v.LINKFLAGS_cxxstlib = []
  45. v.cxxstlib_PATTERN = 'lib%s.a'
  46. def configure(conf):
  47. conf.find_xlcxx()
  48. conf.find_ar()
  49. conf.xlcxx_common_flags()
  50. conf.cxx_load_tools()
  51. conf.cxx_add_flags()
  52. conf.link_add_flags()