Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 1223c25

Browse files
committed
take inspiration from nodejs/node#21371
1 parent 6883e34 commit 1223c25

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ $(V8FILES):
2020
ninja -C deps/v8/out.gn/x64.release v8_monolith
2121

2222
out/config.json: configure
23-
$(error Missing or stale $@, please run ./configure)
23+
@if [ -x out/config.status ]; then \
24+
./out/config.status; \
25+
else \
26+
echo Missing or stale $@, please run ./$<; \
27+
exit 1; \
28+
fi
2429

2530
clean:
2631
rm -rf out

configure

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* eslint-env node */
66
/* eslint-disable prefer-destructuring */
77

8-
const { readFileSync, writeFileSync } = require('fs');
8+
const { readFileSync, writeFileSync, chmodSync } = require('fs');
99

1010
function snekparse(args) {
1111
if (typeof args === 'string') {
@@ -82,14 +82,21 @@ function snekparse(args) {
8282
return argv;
8383
}
8484

85-
const argv = snekparse(process.argv);
85+
const pargv = process.argv.slice(2);
86+
const argv = snekparse(pargv);
8687

8788
const config = {
8889
exposeBinding: argv['expose-binding'] || false,
8990
allowNativesSyntax: argv['allow-natives-syntax'] || false,
9091
exposePrivateSymbols: argv['expose-private-symbols'] || false,
9192
};
9293

94+
writeFileSync('./out/config.status', `#!/bin/sh
95+
set -ex
96+
./configure ${pargv.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(' ')}
97+
`);
98+
chmodSync('./out/config.status', '775');
99+
93100
const current = (() => {
94101
try {
95102
return readFileSync('./out/config.json', 'utf8');

0 commit comments

Comments
 (0)