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.

70 lines
1.6KB

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