Skip to content

Commit b2991dd

Browse files
committed
format the project
1 parent 8e3934f commit b2991dd

File tree

4 files changed

+35
-58
lines changed

4 files changed

+35
-58
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*~
22
_build
3-
_esy
43
*.obj
54
*.out
65
*.compile

scripts/buildocaml.js

+18-23
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ var cp = require("child_process");
44
var path = require("path");
55
var fs = require("fs");
66

7-
var ocamlSrcDir =
8-
process.env.ESY === "true"
9-
? process.env.OCAMLLIB
10-
: path.join(__dirname, "..", "ocaml");
7+
var ocamlSrcDir = path.join(__dirname, "..", "ocaml");
118
var ocamlVersionFilePath = path.join(ocamlSrcDir, "VERSION");
129

1310
/**
@@ -21,7 +18,7 @@ function ensureOCamlExistsSync() {
2118
if (!fs.existsSync(ocamlVersionFilePath)) {
2219
cp.execSync(`tar xzvf ../vendor/ocaml.tar.gz`, {
2320
cwd: ocamlSrcDir,
24-
stdio: [0, 1, 2]
21+
stdio: [0, 1, 2],
2522
});
2623
}
2724
}
@@ -56,26 +53,24 @@ exports.getVersionPrefix = getVersionPrefix;
5653
function build(config) {
5754
ensureOCamlExistsSync();
5855

59-
if (process.env.ESY !== "true") {
60-
var prefix = path.normalize(
61-
path.join(__dirname, "..", "native", getVersionPrefix())
62-
);
63-
64-
if (config) {
65-
var { make } = require("./config.js");
66-
cp.execSync(
67-
"./configure -cc \"gcc -Wno-implicit-function-declaration -fcommon\" -flambda -prefix " +
68-
prefix +
69-
` -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && ${make} clean`,
70-
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }
71-
);
72-
}
56+
var prefix = path.normalize(
57+
path.join(__dirname, "..", "native", getVersionPrefix())
58+
);
7359

74-
cp.execSync(`${make} -j9 world.opt && ${make} install `, {
75-
cwd: ocamlSrcDir,
76-
stdio: [0, 1, 2]
77-
});
60+
if (config) {
61+
var { make } = require("./config.js");
62+
cp.execSync(
63+
'./configure -cc "gcc -Wno-implicit-function-declaration -fcommon" -flambda -prefix ' +
64+
prefix +
65+
` -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && ${make} clean`,
66+
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }
67+
);
7868
}
69+
70+
cp.execSync(`${make} -j9 world.opt && ${make} install `, {
71+
cwd: ocamlSrcDir,
72+
stdio: [0, 1, 2],
73+
});
7974
}
8075

8176
exports.build = build;

scripts/install.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,14 @@ function provideCompiler() {
178178
return myVersion;
179179
} else {
180180
myVersion = "4.06.1";
181-
var ocamlopt =
182-
process.env.ESY === "true"
183-
? "ocamlopt.opt"
184-
: path.join(
185-
__dirname,
186-
"..",
187-
"native",
188-
myVersion,
189-
"bin",
190-
"ocamlopt.opt"
191-
);
181+
var ocamlopt = path.join(
182+
__dirname,
183+
"..",
184+
"native",
185+
myVersion,
186+
"bin",
187+
"ocamlopt.opt"
188+
);
192189
if (!fs.existsSync(ocamlopt)) {
193190
require("./buildocaml.js").build(true);
194191
} else {

scripts/ninja.js

+9-23
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,14 @@ exports.vendorNinjaPath = vendorNinjaPath;
7676
* Note ocamldep.opt has built-in macro handling OCAML_VERSION
7777
*/
7878
var getOcamldepFile = () => {
79-
if (process.env.ESY === "true") {
80-
return `ocamldep.opt`;
81-
} else {
82-
return path.join(
83-
__dirname,
84-
"..",
85-
"native",
86-
require("./buildocaml.js").getVersionPrefix(),
87-
"bin",
88-
"ocamldep.opt"
89-
);
90-
}
79+
return path.join(
80+
__dirname,
81+
"..",
82+
"native",
83+
require("./buildocaml.js").getVersionPrefix(),
84+
"bin",
85+
"ocamldep.opt"
86+
);
9187
};
9288

9389
/**
@@ -749,7 +745,7 @@ function collectTarget(sourceFiles) {
749745
break;
750746
case "HAS_BOTH_RE":
751747
case "HAS_BOTH":
752-
case "HAS_BOTH_RES":
748+
case "HAS_BOTH_RES":
753749
break;
754750
}
755751
}
@@ -1466,7 +1462,6 @@ function setSortedToStringAsNativeDeps(xs) {
14661462
* @returns {string}
14671463
*/
14681464
function getVendorConfigNinja() {
1469-
if (process.env.ESY === "true") return getEnnvConfigNinja();
14701465
var prefix = `../native/${require("./buildocaml.js").getVersionPrefix()}/bin`;
14711466
return `
14721467
ocamlopt = ${prefix}/ocamlopt.opt
@@ -1476,15 +1471,6 @@ ocamlmklib = ${prefix}/ocamlmklib
14761471
ocaml = ${prefix}/ocaml
14771472
`;
14781473
}
1479-
function getEnnvConfigNinja() {
1480-
return `
1481-
ocamlopt = ocamlopt.opt
1482-
ocamlc = ocamlc.opt
1483-
ocamllex = ocamllex.opt
1484-
ocamlmklib = ocamlmklib
1485-
ocaml = ocaml
1486-
`;
1487-
}
14881474

14891475
/**
14901476
* @returns {string}

0 commit comments

Comments
 (0)