Homebrew build with different arch?

You may try the following:

brew edit mysql-connector-c

and then modify the initialization in the "install" block.

Although I did not try this out, you are supposed to do something like this:

ENV['CFLAGS']='xxx'
ENV['LDFLAGS']='xxx'

You might check the example here: Problems with homebrew, can't install anything...


Encountered similar issue installing DevIL. It appears that Homebrew is trying to sanitize commandline parameters passed to tools, at least on ML:

$ brew install -v devil
...
brew: superenv removed: -arch i386
...

It worked for me to edit the formula like in Walty's answer to specify CFLAGS and CXXFLAGS, but run install with a standard environment instead:

$ brew install --env=std devil

Some Formulas have a universal option that would let you compile for both i386 and x86_64 at the same time:

$ brew options sdl
--universal
        Build a universal binary

The mysql-connector-c doesn't offer it as an option but I found it very easy to add the option to another formula I was working on: https://github.com/mxcl/homebrew/pull/18713/files