configure: update compiler probing
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 23 Sep 2017 21:48:12 +0000 (22:48 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 24 Sep 2017 09:24:41 +0000 (10:24 +0100)
commitb73af7389a47bb04d841d749eb8a4e996eb5a271
tree0589af0ece7639d52e65fe01e5df8f10f1ce9cd2
parent5580d200d7ae49cdb4f30913e3ef2d74e431ff60
configure: update compiler probing

- Allow clang to be always guessable as a fallback compiler after gcc.
  This increases the likelihood we have a compiler when one wasn't
  explicitly set before we search through #define definitions to guess
  what platform we're targeting. The fallback can be overridden later
  (e.g. to prefer clang above other fallbacks on specific platforms).
- Add comments to explain the preferred compiler search (inspired by
  comments in QEMU's ./configure).
- Change from only checking $CC to also checking $cross_prefix before
  overriding.
- Switch from setting CC to setting cc when overriding. This fixes the
  case where cc is "gcc" but CC is "i686-w64-mingw32-gcc" on Cygwin64
  when building a 32 bit fio.
- Because it is now possible for no compiler to be set, bail out with an
  explicit error message if we find this is the case.
- Add macOS/Darwin to the platforms that prefer clang as the fallback
  compiler.
- Minor refactoring.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
configure