If CFLAGS/CXXFLAGS is defined in the environment, then presumably the consumer has already determined the set of warnings flags to pass to the compiler, so we shouldn't enable warnings by default in that case.
Makefiles/configure scripts are lenient to this and otherwise they are basically
never relevant to the path of the tool itself, so chop it all off!
Closes#297
Right now we add them before, and we add -Wall by default. This allows
users to manually turn off specific warnings, without having to resort
to a dance of:
```
.warnings(false)
.flag("-Wall")
.flag("-Wno-foo")
```
This strikes a good balance of keeping -Wall on by default, while
minimising the surprising experience observed in
https://github.com/alexcrichton/cc-rs/issues/235.
These were accepted in https://github.com/alexcrichton/gcc-rs/pull/212, but never actually worked and weren't being tested. This fixes the logic errors that prevented the new style from working, and also updates the tests to use the new style.
It allows one to add a flag to the compiler on the condition that the
compiler supports it.
We check if the compiler supports the flag by trying to compile a
simple executable. If there is some output on stderr we consider that
the compiler failed and the flag is not supported.
This adds two configuration options to optionally enable or disable
the `-shared` and `-static` flags. If omitted, musl targets enable
`-static` by default.