carllerche/curl-rust — pull request #16 by alexcrichton (2014-09-09 19:20:37+00:00)
Title: Tweak how curl-rust links to libcurl

A summary of the changes:

* A new package, `curl-sys`, is now responsible for providing making sure the libcurl binary is somewhere.
* The custom build command of `curl-sys` is special-cased per-system:
* OSX - no action is ever taken (`libcurl.dylib` seems to be install by default)
* Windows/Unix - `pkg-config libcurl` is run, and if it succeeds no action is taken.
* Windows/Unix - if `pkg-config` fails, a bundled version of libcurl (stripped of many features) is built as a static library
* The method via which `curl-rust` links to `libcurl` has been modified for per-system rules:
* OSX - `#[link(name = "curl")]` always, because libcurl seems to be installed by default
* Windows - libcurl is always linked statically. This is breaking the assumption of curl-sys in that it *could* find a local version, but the expectation is that it never will. Additionally, `pkg-config` is not run as it's been seen to be flaky between various combinations of mingw/msys/msys2. In this case we manually specify all dependencies (should be constant across windows)
* Linux - The [link-config](https://github.com/alexcrichton/link-config) package is now used, which simply delegates to `pkg-config`.

This is largely all preparation for the inclusion of `curl-rust` in cargo soon.