Skip to content

Commit

Permalink
Warn rather than crash on preprocessor failure.
Browse files Browse the repository at this point in the history
Detect likely failure of the DynASM preprocessor
during configuration and emit a warning line into
the Makefile rather than a command that would crash.
  • Loading branch information
bdw committed Jun 12, 2014
1 parent b8f9f55 commit ff8f477
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Configure.pl
Expand Up @@ -162,14 +162,19 @@
}

if ($args{'enable-jit'}) {
if (system($config{lua} .' -e \'require("bit");\'') == 0) {
$config{dynasm_rule} = '$(CMD)$(LUA) ./3rdparty/dynasm/dynasm.lua -o $@ $<';
}
if ($Config{archname} =~ m/^x86_64/) {
$config{arch} = 'x86_64';
$config{jit} = '$(JIT_X64)';
} else {
say "JIT isn't supported on $Config{archname} yet.";
}
}

# fallback
$config{dynasm_rule} //= '$(MSG) "Warning: Cannot run preprocessor (try reconfigure)"';
$config{arch} //= 'stub';
$config{jit} //= '$(JIT_STUB)';

Expand Down
2 changes: 1 addition & 1 deletion build/Makefile.in
Expand Up @@ -491,7 +491,7 @@ switch no-tracing no-cgoto:

%.c: %.dasc
$(MSG) preprocessing $< to $@
$(CMD)$(LUA) ./3rdparty/dynasm/dynasm.lua -o $@ $<
@dynasm_rule@

src/main@obj@: src/main.c
$(MSG) compiling $@
Expand Down

0 comments on commit ff8f477

Please sign in to comment.