Fix race condition in quickjs build config (#251)

qjsc.com now has a -n do nothing flag so the makefile can create a
localized binary. See also #267 where we have an exciting new change
aiming to address this particular APE gotcha.
This commit is contained in:
Justine Tunney 2021-09-11 22:16:17 -07:00
parent 6ad0602392
commit ad52387b74
2 changed files with 15 additions and 12 deletions

View file

@ -488,6 +488,7 @@ int main(int argc, char **argv)
BOOL bignum_ext = FALSE;
#endif
namelist_t dynamic_module_list;
if (argc == 2 && !strcmp(argv[1], "-n")) return 0;
out_filename = NULL;
output_type = OUTPUT_EXECUTABLE;
cname = NULL;

View file

@ -127,19 +127,23 @@ THIRD_PARTY_QUICKJS_CHECKS = \
$(THIRD_PARTY_QUICKJS_A).pkg \
$(THIRD_PARTY_QUICKJS_A_HDRS:%=o/$(MODE)/%.ok)
o/$(MODE)/third_party/quickjs/qjsc: \
o/$(MODE)/third_party/quickjs/qjsc.com
@cp -f $< $@
@$@ -n
o/$(MODE)/third_party/quickjs/qjscalc.c: \
third_party/quickjs/qjscalc.js \
o/$(MODE)/third_party/quickjs/qjsc.com
o/$(MODE)/third_party/quickjs/qjsc.com -fbignum -o $@ -c $<
third_party/quickjs/qjscalc.js \
o/$(MODE)/third_party/quickjs/qjsc
o/$(MODE)/third_party/quickjs/qjsc -fbignum -o $@ -c $<
o/$(MODE)/third_party/quickjs/repl.c: \
third_party/quickjs/repl.js \
o/$(MODE)/third_party/quickjs/qjsc.com
o/$(MODE)/third_party/quickjs/qjsc.com -o $@ -m -c $<
third_party/quickjs/repl.js \
o/$(MODE)/third_party/quickjs/qjsc.com
o/$(MODE)/third_party/quickjs/qjsc -o $@ -m -c $<
o/$(MODE)/third_party/quickjs/qjs.com.dbg: \
$(THIRD_PARTY_QUICKJS_A_DEPS) \
$(THIRD_PARTY_QUICKJS_A) \
$(THIRD_PARTY_QUICKJS_A).pkg \
$(THIRD_PARTY_QUICKJS) \
o/$(MODE)/third_party/quickjs/qjs.o \
o/$(MODE)/third_party/quickjs/repl.o \
o/$(MODE)/third_party/quickjs/qjscalc.o \
@ -148,9 +152,7 @@ o/$(MODE)/third_party/quickjs/qjs.com.dbg: \
-@$(APELINK)
o/$(MODE)/third_party/quickjs/qjsc.com.dbg: \
$(THIRD_PARTY_QUICKJS_A_DEPS) \
$(THIRD_PARTY_QUICKJS_A) \
$(THIRD_PARTY_QUICKJS_A).pkg \
$(THIRD_PARTY_QUICKJS) \
o/$(MODE)/third_party/quickjs/qjsc.o \
$(CRT) \
$(APE)