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

Commit

Permalink
take inspiration from nodejs/node#21371
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed Jun 16, 2018
1 parent 6883e34 commit 1223c25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ $(V8FILES):
ninja -C deps/v8/out.gn/x64.release v8_monolith

out/config.json: configure
$(error Missing or stale $@, please run ./configure)
@if [ -x out/config.status ]; then \
./out/config.status; \
else \
echo Missing or stale $@, please run ./$<; \
exit 1; \
fi

clean:
rm -rf out
Expand Down
11 changes: 9 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-env node */
/* eslint-disable prefer-destructuring */

const { readFileSync, writeFileSync } = require('fs');
const { readFileSync, writeFileSync, chmodSync } = require('fs');

function snekparse(args) {
if (typeof args === 'string') {
Expand Down Expand Up @@ -82,14 +82,21 @@ function snekparse(args) {
return argv;
}

const argv = snekparse(process.argv);
const pargv = process.argv.slice(2);
const argv = snekparse(pargv);

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

writeFileSync('./out/config.status', `#!/bin/sh
set -ex
./configure ${pargv.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(' ')}
`);
chmodSync('./out/config.status', '775');

const current = (() => {
try {
return readFileSync('./out/config.json', 'utf8');
Expand Down

0 comments on commit 1223c25

Please sign in to comment.