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.

72 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 import Utils
  6. from waflib.Tools import ccroot, ar
  7. from waflib.Configure import conf
  8. @conf
  9. def find_scc(conf):
  10. """
  11. Detect the Sun C compiler
  12. """
  13. v = conf.env
  14. cc = conf.find_program('cc', var='CC')
  15. try:
  16. conf.cmd_and_log(cc + ['-flags'])
  17. except Exception:
  18. conf.fatal('%r is not a Sun compiler' % cc)
  19. v.CC_NAME = 'sun'
  20. conf.get_suncc_version(cc)
  21. @conf
  22. def scc_common_flags(conf):
  23. """
  24. Flags required for executing the sun C compiler
  25. """
  26. v = conf.env
  27. v['CC_SRC_F'] = []
  28. v['CC_TGT_F'] = ['-c', '-o']
  29. # linker
  30. if not v['LINK_CC']: v['LINK_CC'] = v['CC']
  31. v['CCLNK_SRC_F'] = ''
  32. v['CCLNK_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['cprogram_PATTERN'] = '%s'
  44. # shared library
  45. v['CFLAGS_cshlib'] = ['-Kpic', '-DPIC']
  46. v['LINKFLAGS_cshlib'] = ['-G']
  47. v['cshlib_PATTERN'] = 'lib%s.so'
  48. # static lib
  49. v['LINKFLAGS_cstlib'] = ['-Bstatic']
  50. v['cstlib_PATTERN'] = 'lib%s.a'
  51. def configure(conf):
  52. conf.find_scc()
  53. conf.find_ar()
  54. conf.scc_common_flags()
  55. conf.cc_load_tools()
  56. conf.cc_add_flags()
  57. conf.link_add_flags()