Building gcc with --HEAD results in most of the executables not having a
version suffix, e.g. Building/installing gcc 6 would result in gcc-6,
g++-6, etc. being installed, while building/installing gcc --HEAD would
result in gcc-, g++-, etc. being installed.
The lack of a version suffix prevented brew from recognizing a valid gcc
install, resulting in brew instructing users to install gcc before
building certain formulae even though gcc is installed.
A patch to the gcc formula makes the version number for --HEAD builds
the major version number of the stable version + 1 (7 at this time).
This patch teaches brew to recognize current --HEAD builds as valid
compilers.
The major version is implicit in the compiler name. Since the name is
used when matching failures to compilers, we don't need to consider the
major version separately.
`needs` allows formulae to specify dependencies on cross-compiler
dependencies, allowing multiple failures to be specified in a single
statement. For instance, `needs :cxx11` adds seven compiler failures.
ClosesHomebrew/homebrew#22912.
The old version worked like this:
fails_with :gcc => '4.8.1'
That wasn't really flexible enough, and made it harder to distinguish
different releases in the same GCC series. Since no one was really
using it yet, this adjusts the syntax to be more similar to the
Apple compilers:
fails_with :gcc => '4.8' do
release '4.8.1'
end
Like with Apple compilers, omitting `release` blacklists the entire
series.
This also unifies the `build` and `version` attributes and accessors,
and exposes them under both names.
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:
fails_with :gcc => '4.8.1' do
cause 'Foo'
end
Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings instead.
Internally non-Apple compilers can be distinguished because they are
passed around as strings instead of symbols.
In addition, this alters the priority list for compilers, with the
following changes:
* Apple GCC 4.2 and LLVM-GCC swap positions, with GCC now taking
priority. (Maybe LLVM-GCC should just go away.)
* Non-Apple GCC compilers are ranked below GCC 4.2 but above LLVM-GCC
and Apple GCC 4.0.