#wscript# 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # -*- mode: python -*-
  2. import Options, Utils, sys, os
  3. srcdir = "."
  4. blddir = "build"
  5. VERSION = "0.0.1"
  6. node_version = os.popen("node --version").read()
  7. def set_options(opt):
  8. opt.tool_options("compiler_cxx")
  9. opt.tool_options("compiler_cc")
  10. def configure(conf):
  11. conf.check_tool("compiler_cxx")
  12. conf.check_tool("compiler_cc")
  13. conf.check_tool("node_addon")
  14. o = Options.options
  15. libpath = ['/lib', '/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib']
  16. includes = ['/usr/include', '/usr/includes', '/usr/local/includes', '/opt/local/includes', '/usr/sfw/lib'];
  17. def build(bld):
  18. gcstats = bld.new_task_gen("cxx", "shlib", "node_addon")
  19. gcstats.cxxflags = [ "-O3" ]
  20. if node_version.startswith("v0.8"):
  21. # the v8 in node 0.8.x doesn't ever send a kGCCallbackFlagCompacted -
  22. # instead we key of GC type. I don't fully understand this behavioral
  23. # change, but the numbers we get are still stable / similar to 0.6.
  24. gcstats.cxxflags.append("-DNEW_COMPACTION_BEHAVIOR=1")
  25. gcstats.target = "memwatch"
  26. gcstats.source = """
  27. src/memwatch.cc
  28. src/heapdiff.cc
  29. src/util.cc
  30. src/init.cc
  31. """
  32. def test(t):
  33. Utils.exec_command('make test')