The major version must still be an exact match since libgit2 uses
semantic versioning and changes to the major number indicate backwards
incompatible changes to the API.
Fixes: #695
This change allows to link the system version of libgit2 statically.
Since `-tags static` is already used for the bundled version of the
library and to avoid breaking old workflows, `-tags
static,system_libgit2` is now used to select that.
This means that the valid combinations are:
| Flag | Effect |
|-------------------------------|-----------------------------------------------|
| _No flags_ | Dynamically-linked against the system libgit2 |
| `-tags static,system_libgit2` | Statically-linked against the system libgit2 |
| `-tags static` | Statically-linked against the bundled libgit2 |
Note that there is no way to express dynamically linking against the
bundled libgit2 because that makes very little sense, since the binaries
wouldn't be able to be distributed. If that's still desired, the
`PKG_CONFIG_PATH` environment variable can set before building the code.
[`Makefile`](https://github.com/libgit2/git2go/blob/master/Makefile) has
an example of how it is used in the CI.