Files
node-dtrace-provider/wscript
T
Chris Andrews 948fa1a05e Build updates: add binding.gyp, improve loading of DTrace extension.
This adds GYP support, simplifying the existing wscript to always build for
32 bit. The loading of the bindings is improves to only log load errors if
we believe the bindings should have loaded, silencing an error of no use on
Linux or Windows.
2012-08-15 08:40:57 +01:00

31 lines
879 B
Python

import Options, Utils, sys
from os import unlink, symlink, popen
from os.path import exists, islink
srcdir = '.'
blddir = 'build'
VERSION = '0.2.0'
libusdtdir = 'libusdt'
def set_options(ctx):
ctx.tool_options('compiler_cxx')
def configure(ctx):
ctx.check_tool('compiler_cxx')
ctx.check_tool('node_addon')
def build(ctx):
if sys.platform.startswith("sunos") or sys.platform.startswith("darwin") or sys.platform.startswith("freebsd"):
ctx.new_task_gen(
rule = "cd ../" + libusdtdir + " && ARCH=i386 make clean all && cd -",
shell = True
)
t = ctx.new_task_gen('cxx', 'shlib', 'node_addon')
t.target = 'DTraceProviderBindings'
t.source = ['dtrace_provider.cc', 'dtrace_probe.cc']
t.includes = [libusdtdir]
t.staticlib = 'usdt'
t.libpath = "../" + libusdtdir