diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-16 22:17:45 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-17 00:44:26 +0400 |
commit | 3d1476a3168effe3edb32510f56cf9b00bce8392 (patch) | |
tree | e45162890e972ec3326d191a0b6400da3121ddf0 /tools | |
parent | d5047f5fe669c0434da99e2aacd197e228d040a4 (diff) |
gyp: install node-gyp
* fixes #2480
Diffstat (limited to 'tools')
-rw-r--r-- | tools/addon.gypi | 17 | ||||
-rw-r--r-- | tools/installer.js | 11 | ||||
-rwxr-xr-x | tools/node-gyp (renamed from tools/gyp_addon) | 8 |
3 files changed, 25 insertions, 11 deletions
diff --git a/tools/addon.gypi b/tools/addon.gypi index e7152afe4bf..20dc2b9e06d 100644 --- a/tools/addon.gypi +++ b/tools/addon.gypi @@ -3,15 +3,20 @@ 'type': 'loadable_module', 'product_extension': 'node', 'product_prefix': '', - 'include_dirs': [ - '../src', - '../deps/uv/include', - '../deps/v8/include' - ], 'conditions': [ [ 'OS=="mac"', { - 'libraries': [ '-undefined dynamic_lookup' ], + 'libraries': [ '-undefined dynamic_lookup' ] + }], + [ 'OS=="win"', { + 'include_dirs': [ + '../src', + '../deps/uv/include', + '../deps/v8/include' + ], + 'libraries': [ '-l<(node_root_dir>/Debug/node.lib' ], + }, { + 'include_dirs': ['../../../include/node'] }] ] } diff --git a/tools/installer.js b/tools/installer.js index f4a07c52184..7269d06100d 100644 --- a/tools/installer.js +++ b/tools/installer.js @@ -93,7 +93,13 @@ if (cmd === 'install') { copy([ 'deps/uv/include/ares.h', 'deps/uv/include/ares_version.h' - ], 'include/node/c-ares/'); + ], 'include/node/'); + + // Copy node-gyp files + copy('common.gypi', 'lib/node/'); + copy('tools/*', 'lib/node/tools/'); + queue.push('ln -sf ../lib/node/tools/node-gyp ' + + path.join(node_prefix, 'bin/node-gyp')); // Copy binary file copy('out/Release/node', 'bin/node'); @@ -106,7 +112,8 @@ if (cmd === 'install') { } } else { remove([ - 'bin/node', 'bin/npm', 'include/node/*', 'lib/node_modules' + 'bin/node', 'bin/npm', 'bin/node-gyp', 'include/node/*', + 'lib/node', 'lib/node_modules' ]); } diff --git a/tools/gyp_addon b/tools/node-gyp index a93f7b27d91..14b71397416 100755 --- a/tools/gyp_addon +++ b/tools/node-gyp @@ -4,18 +4,20 @@ import sys script_dir = os.path.dirname(__file__) node_root = os.path.normpath(os.path.join(script_dir, os.pardir)) +node_tools = os.path.join(node_root, 'lib', 'node', 'tools') -sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib')) +sys.path.insert(0, os.path.join(node_tools, 'gyp', 'pylib')) import gyp if __name__ == '__main__': args = sys.argv[1:] - addon_gypi = os.path.join(node_root, 'tools', 'addon.gypi') - common_gypi = os.path.join(node_root, 'common.gypi') + addon_gypi = os.path.join(node_tools, 'addon.gypi') + common_gypi = os.path.join(node_root, 'lib', 'node', 'common.gypi') args.extend(['-I', addon_gypi]) args.extend(['-I', common_gypi]) args.extend(['-Dlibrary=shared_library']) args.extend(['-Dvisibility=default']) + args.extend(['-Dnode_root_dir=%s' % node_root]) args.extend(['--depth=.']); gyp_args = list(args) |