Skip to content

Commit

Permalink
openssl, refactor: update OpenSSL configuration files.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Jul 21, 2024
1 parent 33eceb7 commit 903c37d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions openssl/tools/gen_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
"-fPIC",
"no-shared",
"no-module",
"no-md4",
"no-mdc2",
"no-whirlpool",
"-w"
]
4 changes: 3 additions & 1 deletion openssl/tools/gen_darwin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const child_process = require('child_process');
const fs = require('fs');

const gen_config = require("./gen_config.json");

const darwin_config = {
"x64": {
"arch": "darwin64-x86_64"
Expand All @@ -19,7 +21,7 @@ for (var arch in darwin_config) {
});
} catch (e) { }

if (child_process.run("bash", ["../../openssl/config", config.arch, "-fPIC", "no-shared", "no-module", "no-md4", "no-mdc2", "no-whirlpool", "-w"], {
if (child_process.run("bash", ["../../openssl/config", config.arch].concat(gen_config), {
cwd: `build/darwin_${arch}`
}))
throw new Error("openssl config failed");
Expand Down
4 changes: 3 additions & 1 deletion openssl/tools/gen_linux.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const child_process = require('child_process');
const fs = require('fs');

const gen_config = require("./gen_config.json");

const linux_config = {
"x64": {
"arch": "linux-x86_64",
Expand Down Expand Up @@ -47,7 +49,7 @@ for (var arch in linux_config) {
});
} catch (e) { }

if (child_process.run("bash", ["../../openssl/config", config.arch, "-fPIC", "no-shared", "no-module", "no-md4", "no-mdc2", "no-whirlpool", "-w"], {
if (child_process.run("bash", ["../../openssl/config", config.arch].concat(gen_config), {
cwd: `build/linux_${arch}`,
env: {
CC: config.prefix + "gcc",
Expand Down
4 changes: 3 additions & 1 deletion openssl/tools/gen_win.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const child_process = require('child_process');
const fs = require('fs');

const gen_config = require("./gen_config.json");

const windows_config = {
"x64": {
"arch": "VC-WIN64A",
Expand Down Expand Up @@ -37,7 +39,7 @@ for (var arch in windows_config) {
}
};

if (child_process.run("perl", ["..\\..\\openssl\\Configure", config.arch, "no-shared", "no-module", "no-md4", "no-mdc2", "no-whirlpool", "-w"], opts))
if (child_process.run("perl", ["..\\..\\openssl\\Configure", config.arch].concat(gen_config), opts))
throw new Error("openssl config failed");
if (child_process.run("nmake", ["build_libs"], opts))
throw new Error("openssl build failed");
Expand Down

0 comments on commit 903c37d

Please sign in to comment.