Make configure script respect (and save) values for `CC`, `CXX`, `CFLAGS`, etc.

I mostly tried to remain backwards compatible with old invocations of
the `configure` script; if you do not want to use `CC` et al., you
should not have to; you can keep using `--enable-clang` and/or
`--enable-ccache`.

The overall intention is to capture the following precedences for
guessing the C compiler:

 1. Value of `CC` at make invocation time.
 2. Value of `CC` at configure invocation time.
 3. Compiler inferred at configure invocation time (`gcc` or `clang`).

The strategy is to check (at `configure` time) if each of the
environment variables is set, and if so, save its value in a
corresponding `CFG_` variable (e.g. `CFG_CC`).

The `configure` script also does not attempt to infer the compiler if
`CC` is set; but if `--enable-clang` was passed, then it *does* still
attempt to validate that the clang version is compatible.

Then, in the makefiles, if `CC` is not set but `CFG_CC` is, then we
use the `CFG_CC` setting as `CC`.

Fix #13805.
Some cleanup on respecting `CC`/`CXX`/`CFLAGS`/etc.

Address scenario where client passes --enable-clang while setting `CC`
to non-clang program (e.g. `CC=gcc`), by only checking clang version
if `CFG_CC` ends up looking like a variant of clang.

Fixed code to infer a `CFG_CXX` from the `CFG_CC` if necessary; we
were already doing this in an ad-hoc way in the part of the script
where we set up `LLVM_CXX`.  Doing it at the top-level let me cleanup
and generalize that code so that it handles values other than the four
fix cases that had been hard-coded earlier.

(It warns you if you try to use a compiler it didn't anticipate, but
makes a best effort to try to set up the options in a reasonable
manner even then.  It would be interesting to try to build against
`icc` with these changes.)

----

It seems likely that we could clean this code up further; in
particular I cannot tell why we are both adding `-m32` to the
`LLVM_CC_32`/`LLVM_CXX_32` and *also* to `LLVM_CFLAGS_32` and
`LLVM_CXXFLAGS_32` variables; the latter alone should suffice in
principle.
auto merge of #13823 : pnkfelix/rust/fsk-fix-13805, r=alexcrichton

Make configure script respect (and save) values for `CC`, `CXX`, `CFLAGS` etc.

I mostly tried to remain backwards compatible with old invocations of
the `configure` script; if you do not want to use `CC` et al., you
should not have to; you can keep using `--enable-clang` and/or
`--enable-ccache`.

The overall intention is to capture the following precedences for
guessing the C compiler:

 1. Value of `CC` at `make` invocation time.
 2. Value of `CC` at `configure` invocation time.
 3. Compiler inferred at configure invocation time (`gcc` or `clang`).

The strategy is to check (at `configure` time) if each of the
environment variables is set, and if so, save its value in a
corresponding `CFG_` variable (e.g. `CFG_CC`).

The `configure` script also does not attempt to infer the compiler if
`CC` is set; but if `--enable-clang` was passed, then it *does* still
attempt to validate that the clang version is compatible.

Then, in the makefiles, if `CC` is not set but `CFG_CC` is, then we
use the `CFG_CC` setting as `CC`.

Fix #13805.