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