Skip to content

Commit 9b96bfd

Browse files
committedAug 1, 2020
Fix building ocaml on FreeBSD
ocaml's Makefile is a GNU Makefile. FreeBSD's make is not GNU make, it's bsd make. To execute GNU Makefile on FreeBSD one must use gmake.
1 parent d6ad258 commit 9b96bfd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎scripts/buildocaml.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,16 @@ function build(config) {
6262
);
6363

6464
if (config) {
65+
var { make } = require("./config.js");
6566
cp.execSync(
6667
"./configure -flambda -prefix " +
6768
prefix +
68-
" -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && make clean",
69+
` -no-ocamlbuild -no-curses -no-graph -no-pthread -no-debugger && ${make} clean`,
6970
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }
7071
);
7172
}
7273

73-
cp.execSync("make -j9 world.opt && make install ", {
74+
cp.execSync(`${make} -j9 world.opt && ${make} install `, {
7475
cwd: ocamlSrcDir,
7576
stdio: [0, 1, 2]
7677
});

‎scripts/config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var os = require('os')
33
var os_type = os.type()
44

55
var is_windows = !(os_type.indexOf('Windows') < 0)
6-
// var is_bsd = !(os_type.indexOf('BSD') < 0)
6+
var is_bsd = !(os_type.indexOf('BSD') < 0)
77

88
exports.is_windows = is_windows
99
var sys_extension;
@@ -17,7 +17,7 @@ switch (os.type()) {
1717
}
1818

1919
exports.sys_extension = sys_extension
20-
// var make = is_bsd ? 'gmake' : 'make'
21-
// exports.make = make
20+
var make = is_bsd ? 'gmake' : 'make'
21+
exports.make = make
2222

2323

0 commit comments

Comments
 (0)
Please sign in to comment.