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.

69 lines
1.5KB

  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2006-2010 (ita)
  4. # Ralf Habacker, 2006 (rh)
  5. from waflib.Tools import ccroot, ar
  6. from waflib.Configure import conf
  7. @conf
  8. def find_sxx(conf):
  9. """
  10. Detect the sun C++ compiler
  11. """
  12. v = conf.env
  13. cc = conf.find_program(['CC', 'c++'], var='CXX')
  14. try:
  15. conf.cmd_and_log(cc + ['-flags'])
  16. except Exception:
  17. conf.fatal('%r is not a Sun compiler' % cc)
  18. v.CXX_NAME = 'sun'
  19. conf.get_suncc_version(cc)
  20. @conf
  21. def sxx_common_flags(conf):
  22. """
  23. Flags required for executing the sun C++ compiler
  24. """
  25. v = conf.env
  26. v['CXX_SRC_F'] = []
  27. v['CXX_TGT_F'] = ['-c', '-o']
  28. # linker
  29. if not v['LINK_CXX']: v['LINK_CXX'] = v['CXX']
  30. v['CXXLNK_SRC_F'] = []
  31. v['CXXLNK_TGT_F'] = ['-o']
  32. v['CPPPATH_ST'] = '-I%s'
  33. v['DEFINES_ST'] = '-D%s'
  34. v['LIB_ST'] = '-l%s' # template for adding libs
  35. v['LIBPATH_ST'] = '-L%s' # template for adding libpaths
  36. v['STLIB_ST'] = '-l%s'
  37. v['STLIBPATH_ST'] = '-L%s'
  38. v['SONAME_ST'] = '-Wl,-h,%s'
  39. v['SHLIB_MARKER'] = '-Bdynamic'
  40. v['STLIB_MARKER'] = '-Bstatic'
  41. # program
  42. v['cxxprogram_PATTERN'] = '%s'
  43. # shared library
  44. v['CXXFLAGS_cxxshlib'] = ['-xcode=pic32', '-DPIC']
  45. v['LINKFLAGS_cxxshlib'] = ['-G']
  46. v['cxxshlib_PATTERN'] = 'lib%s.so'
  47. # static lib
  48. v['LINKFLAGS_cxxstlib'] = ['-Bstatic']
  49. v['cxxstlib_PATTERN'] = 'lib%s.a'
  50. def configure(conf):
  51. conf.find_sxx()
  52. conf.find_ar()
  53. conf.sxx_common_flags()
  54. conf.cxx_load_tools()
  55. conf.cxx_add_flags()
  56. conf.link_add_flags()