diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-10-04 13:50:53 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-10-04 13:50:53 +0400 |
commit | 7b8842b619a6b7eb235c2073d295571075f9fe5c (patch) | |
tree | cbbbf67b59d80e657b25540e4d0638209bc0d773 /tools | |
parent | 5c9fe1fce11f25f4a73c6b7560802e6141a3e733 (diff) |
Modify node_addon configure api
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wafadmin/Tools/node_addon.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/wafadmin/Tools/node_addon.py b/tools/wafadmin/Tools/node_addon.py index 6372d0b812a..4fa1e006d1d 100644 --- a/tools/wafadmin/Tools/node_addon.py +++ b/tools/wafadmin/Tools/node_addon.py @@ -1,14 +1,14 @@ import os import TaskGen, Utils, Utils, Runner, Options, Build from TaskGen import extension, taskgen, before, after, feature -from Configure import conf +from Configure import conf, conftest @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.default_install_path = '${PREFIX_NODE}/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 @@ -20,15 +20,19 @@ def init_node_addon(self): def node_addon_shlib_ext(self): self.env['shlib_PATTERN'] = "%s.node" -@conf -def check_node_headers(conf): +def detect(conf): join = os.path.join - wafadmin = join(os.path.dirname(__file__), '..') - libnode = join(wafadmin, '..') - lib = join(libnode, '..') - prefix = join(lib, '..') + abspath = os.path.abspath + wafadmin = abspath(join(os.path.dirname(__file__), '..')) + libnode = abspath(join(wafadmin, '..')) + lib = abspath(join(libnode, '..')) + prefix = abspath(join(lib, '..')) + + conf.env['PREFIX_NODE'] = prefix 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' + found = os.path.exists(join(prefix, "bin/node")) + conf.check_message('node prefix', '', found, prefix) |