webrtc-audio-processing
webrtc-audio-processing copied to clipboard
Set --host flag for autotools to support cross compilation
https://docs.rs/autotools/0.2.1/autotools/struct.Config.html#method.host
It's set automatically, but based on the compilation host. We want the target architecture to be set for --host
flag.
LGTM!
@skywhale @bschwind Sorry to dig this up after 3 years. Let's finish this. .) Seems like we could just merge? If not, let's close this.
We should probably test before merging though, by successfully cross-compiling this library with this branch.
I'll give it a try. I just need to make the regular compilation work first. (something something c++ errors out)
@bschwind Tested this by successfully compiling for x86 macOS on an arm macOS. You need to have have the target's rust toolchaing installed and you also need to set PKG_CONFIG_SYSROOT_DIR
to this weird value (found out here)
I pushed an additional commit that documents this in the README.
PKG_CONFIG_SYSROOT_DIR=/ cargo build --target x86_64-apple-darwin
@skywhale
Do you remember why you wrote this?
We want the target architecture to be set for --host flag.
Yes, rust's "target" is "host" in autotools's nomenclature, but the autotools crate docs say:
The host and target methods on this package’s autotools::Config structure (as well as the $HOST and $TARGET variables set by cargo) are understood with their Rust meaning.
Anyway, I think I've lost too much time on this trying to debug opaque autoconf//gcc/cc errors. If anyone else won't pick this up let's close it as stale.