alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1.01k stars 234 forks source link

Haiku: rework build.rs logic for curl-sys #375

Closed nielx closed 3 years ago

nielx commented 3 years ago

Due to several issues, the Haiku build of rustc and cargo is cross-compiled from a Linux host. In this official build, it is prefered to link to the libcurl build that is being distributed as an official Haiku port. This change adds the logic to link to the official libcurl build when cross-compiling. The previous logic was flawed, in the sense that it would rely on the hosts curl-config to determine whether http2 support was available.

When doing a native build, pkg_config can be used to determine whether libcurl is available on the platform, thus removing the need for separate logic when building curl-sys on Haiku itself.

The change was tested manually on Haiku and in a cross-compile from Linux.

alexcrichton commented 3 years ago

Thanks!