diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index dbe70ab5c..a0d1a88d9 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -1,33 +1,13 @@ { "conditions": [ ["(OS=='win' and node_root_dir.split('\\\\')[-1].startswith('iojs')) or (OS=='mac' and node_root_dir.split('/')[-1].startswith('iojs'))", { - "conditions": [ - ["OS=='win'", { - "variables": { - "is_electron%": "1", - "openssl_include_dir%": "<(module_root_dir)\\vendor\\openssl" - } - }, { - "variables": { - "is_electron%": "1", - "openssl_include_dir%": "<(module_root_dir)/vendor/openssl" - } - }] - ], + "variables": { + "is_electron%": "1", + } }, { - "conditions": [ - ["OS=='win'", { - "variables": { - "is_electron%": "0", - "openssl_include_dir%": "<(node_root_dir)\\include\\node" - } - }, { - "variables": { - "is_electron%": "0", - "openssl_include_dir%": "<(node_root_dir)/include/node" - } - }] - ] + "variables": { + "is_electron%": "0", + } }] ], @@ -50,7 +30,7 @@ "target_name": "configureLibssh2", "actions": [{ "action_name": "configure", - "action": ["node", "utils/configureLibssh2.js", "<(openssl_include_dir)", "<(is_electron)"], + "action": ["node", "utils/configureLibssh2.js"], "inputs": [""], "outputs": [""] }], diff --git a/utils/configureLibssh2.js b/utils/configureLibssh2.js index 3ee8cd933..befdb4594 100644 --- a/utils/configureLibssh2.js +++ b/utils/configureLibssh2.js @@ -1,5 +1,5 @@ var cp = require("child_process"); -var fse = require('fs-extra'); +var fse = require("fs-extra"); var path = require("path"); const libssh2VendorDirectory = path.resolve(__dirname, "..", "vendor", "libssh2"); @@ -19,27 +19,13 @@ module.exports = function retrieveExternalDependencies() { // Run the `configure` script on Linux return new Promise(function(resolve, reject) { - - var opensslDir = process.argv[2]; - var isElectron = process.argv[3] === "1"; - var opensslIncludes = isElectron ? path.join(opensslDir, "includes") : opensslDir; - var newEnv = {}; Object.keys(process.env).forEach(function(key) { newEnv[key] = process.env[key]; }); - newEnv.CPPFLAGS = newEnv.CPPFLAGS || ""; - newEnv.CPPFLAGS += ` -I${opensslIncludes}`; - newEnv.CPPFLAGS = newEnv.CPPFLAGS.trim(); - - var maybeLibsslPrefix = ""; - if (isElectron) { - maybeLibsslPrefix = ` --with-libssl-prefix=${opensslDir}`; - } - cp.exec( - libssh2ConfigureScript + maybeLibsslPrefix, + libssh2ConfigureScript, { cwd: libssh2VendorDirectory, env: newEnv