Homebrew/homebrew — pull request #32011 by jacknagel (2014-08-31 20:38:16+00:00)
Title: Overhaul compiler selection code

There are three main things I want to fix in the compiler selection process:

1. `--cc=` should override any fails_with declarations, so that other compilers can be tested without editing the formula
* `setup_build_environment` should only set the compiler once, instead of once plus a second time if `fails_with?` returns true
* allow extra compiler failure objects to be passed into the selector at runtime, so that `build.cxx11?` can imply `needs :cxx11`

This pull request implements (1) and (2), and lays the groundwork for (3).

In particular, the compiler priority queue is gone, replaced with static lists based on `MacOS.default_compiler`. `fails_with?` is moved from the formula instance into the selector, where that logic belongs.

Open questions:

* In this PR, both `--cc=` and `HOMEBREW_CC` override any `fails_with` declarations because they share the same code path. But `HOMEBREW_CC` can be set permanently by the user, so that's likely not the behavior we want. They should probably be handled separately, but it's not clear to me how setting `HOMEBREW_CC` should influence the selection logic.