Skip to content

Commit 4c2af33

Browse files
maxkorpsrajko
authored andcommitted
configure libssh2 against included openssl install
1 parent e946dff commit 4c2af33

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lifecycleScripts/configureLibssh2.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@ module.exports = function retrieveExternalDependencies() {
99

1010
return new Promise(function(resolve, reject) {
1111
console.info("[nodegit] Configuring libssh2.");
12-
cp.execFile(
13-
rooted("vendor/libssh2/") + "configure",
14-
{cwd: rooted("vendor/libssh2/")},
12+
var opensslDir = rooted("vendor/openssl/openssl");
13+
var newEnv = {};
14+
Object.keys(process.env).forEach(function(key) {
15+
newEnv[key] = process.env[key];
16+
});
17+
newEnv.CPPFLAGS = newEnv.CPPFLAGS || "";
18+
newEnv.CPPFLAGS += " -I" + path.join(opensslDir, "include");
19+
newEnv.CPPFLAGS = newEnv.CPPFLAGS.trim();
20+
21+
cp.exec(
22+
rooted("vendor/libssh2/configure") +
23+
" --with-libssl-prefix=" + opensslDir,
24+
{cwd: rooted("vendor/libssh2/"), env: newEnv},
1525
function(err, stdout, stderr) {
1626
if (err) {
1727
console.error(err);

0 commit comments

Comments
 (0)