cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.89k stars 983 forks source link

configure: improve inference of compiler flags for pb builds #829

Closed mflatt closed 2 months ago

mflatt commented 2 months ago

A follow-up to #828

When building an pb variant like tpb64l, and even when building for a platform without native-code support, the "configure" script may still be able to infer suitable C compilation and linking flags for the kernel. For example, configuring with just -m=tpb64l on ppc64l Linux should pick up good compiler and linker flags.

An --os=... flag can override inference in "configure" in case it's not correct, which might be needed for cross compilation of pb variants.

With these changes, -m=pb by itself is now equivalent to --pb, instead of triggering an error to say that --pb must be used. Using -m=pb is not equivalent to --pb in all cases, since --pb --threads is like -m=tpb, but -m=pb --threads would be an error due to the mismatch between an explicit pb machine type and --threads flag. The interactions are subtle, but I'm hopeful that "configure" now does the right thing in more cases.

nmeum commented 2 months ago

This look great, thanks for following up on this! Should make it easier for us to support portable bytecode targets downstream :)