Homebrew/homebrew — pull request #17352 by jacknagel (2014-05-11 01:50:56+00:00)
Title: Handling non-standard universal builds under superenv

For the purposes of this discussion, the "standard" universal build is the current behavior of `ENV.universal_binary`: passing `-arch i386 -arch x86_64` to the compiler and linker.

Currently this works under both superenv and stdenv, but superenv doesn't handle things that diverge from this convention, e.g. mysql:

```
args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if build.universal?
```

this formula does not call `ENV.universal_binary`, so any arch flags that the build system passes to the compiler will be filtered out. The procedure for handling this has thus far been to punt and add `env :std if build.universal?` to the formula.

So we need to to add a switch to superenv that doesn't explicitly add universal arch flags, but doesn't filter them out, either.

One possibility would be to keep a struct representing the universal "mode" (e.g. `allow_universal_flags` or `add_universal_flags`) on the formula's BuildEnvironment object, and pass it into superenv during universal builds.