libgit2/libgit2 — pull request #2414 by phkelley (2014-06-09 14:58:14+00:00)
Title: Win32: Enable WinHTTP for MinGW

This change enables the use of WinHTTP in the MinGW Win32 build. We were previously not doing this because MinGW does not come with a header file for WinHTTP (`winhttp.h`) or an import library (`libwinhttp.a`).

To work around this, I have grabbed the LGPL copy of winhttp.h from the Wine project, and added logic to the build to generate the import library (`libwinhttp.a`) from a hand-made .def file. This import library generation is done using dlltool, which is a standard part of the MinGW distribution. I also created a minimal `urlmon.h`, needed for us to call `MapUrlToZone` and find out whether to use the user's 'default credentials' when authenticating to a Windows-based Git HTTP server.

This change creates greater alignment between the MSVC and MinGW builds. They now both are able to pass the "online" test suite in their default configuration, without having to set up OpenSSL, etc.

I also modified how our CI build performs the MinGW build on Linux. We now use a custom toolchain file. This has the following advantages:
* Far fewer warnings emitted by the build. The previous iteration was very noisy.
* The CI build creates actual PE binaries (libgit2.dll and libgit2_clar.exe) instead of ELF.
* The build no longer skips the creation of the test suite binary, so we have expanded compile-time coverage on Win32.