diff --git a/bin/node-waf b/bin/node-waf new file mode 100755 index 0000000000..b0280eb0bd --- /dev/null +++ b/bin/node-waf @@ -0,0 +1,17 @@ +#!/usr/bin/env python +import os, sys + + +join = os.path.join +bindir = os.path.dirname(__file__) +prefix = join(bindir, "..") +wafdir = join(prefix, "lib", "node") + +w = join(wafdir, 'wafadmin') +t = join(w, 'Tools') +sys.path = [w, t] + sys.path + +import Scripting +VERSION="1.5.9" +Scripting.prepare(t, os.getcwd(), VERSION, wafdir) +sys.exit(0) diff --git a/tools/wafadmin/Tools/node_addon.py b/tools/wafadmin/Tools/node_addon.py new file mode 100644 index 0000000000..6372d0b812 --- /dev/null +++ b/tools/wafadmin/Tools/node_addon.py @@ -0,0 +1,34 @@ +import os +import TaskGen, Utils, Utils, Runner, Options, Build +from TaskGen import extension, taskgen, before, after, feature +from Configure import conf + +@taskgen +@before('apply_incpaths', 'apply_lib_vars', 'apply_type_vars') +@feature('node_addon') +@before('apply_bundle') +def init_node_addon(self): + self.default_install_path = '${PREFIX}/lib/node/libraries' + self.uselib = self.to_list(getattr(self, 'uselib', '')) + if not 'NODE' in self.uselib: self.uselib.append('NODE') + self.env['MACBUNDLE'] = True + +@taskgen +@before('apply_link', 'apply_lib_vars', 'apply_type_vars') +@after('apply_bundle') +@feature('node_addon') +def node_addon_shlib_ext(self): + self.env['shlib_PATTERN'] = "%s.node" + +@conf +def check_node_headers(conf): + join = os.path.join + wafadmin = join(os.path.dirname(__file__), '..') + libnode = join(wafadmin, '..') + lib = join(libnode, '..') + prefix = join(lib, '..') + conf.env['LIBPATH_NODE'] = lib + conf.env['CPPPATH_NODE'] = join(prefix, 'include/node') + conf.env['CPPFLAGS_NODE'] = '-D_GNU_SOURCE' + conf.env['CPPFLAGS_NODE'] = '-DEV_MULTIPLICITY=0' +