Teach brew to recognize gcc-HEAD as valid compiler

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.
This commit is contained in:
Alex Wang 2016-09-13 15:03:37 -04:00
parent b505ee3fed
commit 4cec6f5dd0

View File

@ -1,7 +1,7 @@
# @private
module CompilerConstants
GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6]
GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-6])$/
GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6 7]
GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-7])$/
COMPILER_SYMBOL_MAP = {
"gcc-4.0" => :gcc_4_0,
"gcc-4.2" => :gcc,