diff options
author | isaacs <i@izs.me> | 2013-11-20 22:04:37 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-11-20 22:04:37 +0400 |
commit | 2c22228ceeb4ff4ee30907c696c4af11fe551169 (patch) | |
tree | f4012ec91641332d905a2bb4b9513d538891ab66 /node_modules/node-gyp/lib/configure.js | |
parent | 0490394873b4b582bbfba782c1e93ad96bcceeb9 (diff) |
node-gyp@0.12
Diffstat (limited to 'node_modules/node-gyp/lib/configure.js')
-rw-r--r-- | node_modules/node-gyp/lib/configure.js | 134 |
1 files changed, 2 insertions, 132 deletions
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js index 0dcd2852d..e101a315a 100644 --- a/node_modules/node-gyp/lib/configure.js +++ b/node_modules/node-gyp/lib/configure.js @@ -24,30 +24,11 @@ function configure (gyp, argv, callback) { var python = gyp.opts.python || process.env.PYTHON || 'python' , buildDir = path.resolve('build') - , hasVCExpress = false - , hasVC2012Express = false - , hasWin71SDK = false - , hasWin8SDK = false , configNames = [ 'config.gypi', 'common.gypi' ] , configs = [] , nodeDir - - if (win) { - checkVCExpress(function () { - if (hasVCExpress || hasVC2012Express) { - checkWinSDK(function () { - checkVSPrompt(function() { - checkPython() - }) - }) - } else { - checkPython() - } - }) - } else { - checkPython() - } + checkPython() // Check if Python is in the $PATH function checkPython () { @@ -127,108 +108,6 @@ function configure (gyp, argv, callback) { 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.')) } - function checkVSPrompt(cb) { - // in the event that they have both installed, see if they are using a particular command prompt - if (hasVCExpress && hasVC2012Express) { - if (process.env["VisualStudioVersion"] === "11.0") { - // they are using the VS 2012 command prompt, unset the VS 2010 variables - hasVCExpress = false - hasWin71SDK = false - } else { - // otherwise, unset the VS 2012 variables - hasVC2012Express = false - hasWin8SDK = false - } - } - cb() - } - - function checkWinSDK(cb) { - checkWin71SDK(function() { - checkWin8SDK(cb) - }) - } - - function checkWin71SDK(cb) { - spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows\\v7.1', '/v', 'InstallationFolder']) - .on('exit', function (code) { - hasWin71SDK = (code === 0) - cb() - }) - } - - function checkWin8SDK(cb) { - var cp = spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\Windows Kits\\Installed Products', '/f', 'Windows Software Development Kit x86', '/reg:32']) - cp.on('exit', function (code) { - hasWin8SDK = (code === 0) - cb() - }) - } - - function checkVC201264(cb) { - var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC', '/v', 'ProductDir']) - cp.on('exit', function (code) { - hasVC2012Express = (code === 0) - cb() - }) - } - - function checkVC2012(cb) { - var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC', '/v', 'ProductDir']) - cp.on('exit', function (code) { - hasVC2012Express = (code === 0) - if (code !== 0) { - checkVC201264(cb) - } else { - cb() - } - }) - } - - function checkVC2012Express64(cb) { - var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\VCExpress\\11.0\\Setup\\VC', '/v', 'ProductDir']) - cp.on('exit', function (code) { - hasVC2012Express = (code === 0) - if (code !== 0) { - checkVC2012(cb) - } else { - cb() - } - }) - } - - function checkVC2012Express(cb) { - var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC', '/v', 'ProductDir']) - cp.on('exit', function (code) { - hasVC2012Express = (code === 0) - if (code !== 0) { - checkVC2012Express64(cb) - } else { - cb() - } - }) - } - - function checkVCExpress64(cb) { - var cp = spawn('cmd', ['/C', '%WINDIR%\\SysWOW64\\reg', 'query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir']) - cp.on('exit', function (code) { - hasVCExpress = (code === 0) - checkVC2012Express(cb) - }) - } - - function checkVCExpress(cb) { - spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir']) - .on('exit', function (code) { - hasVCExpress = (code === 0) - if (code !== 0) { - checkVCExpress64(cb) - } else { - checkVC2012Express(cb) - } - }) - } - function getNodeDir () { // 'python' should be set by now @@ -324,15 +203,6 @@ function configure (gyp, argv, callback) { // set the target_arch variable variables.target_arch = gyp.opts.arch || process.arch || 'ia32' - // set the toolset for VCExpress users - if (win) { - if (hasVC2012Express && hasWin8SDK) { - defaults.msbuild_toolset = 'v110' - } else if (hasVCExpress && hasWin71SDK) { - defaults.msbuild_toolset = 'Windows7.1SDK' - } - } - // set the node development directory variables.nodedir = nodeDir @@ -425,7 +295,7 @@ function configure (gyp, argv, callback) { }) // this logic ported from the old `gyp_addon` python file - var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp') + var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') var common_gypi = path.resolve(nodeDir, 'common.gypi') var output_dir = 'build' |