The Computer Oracle

Homebrew build with different arch?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping

--

Chapters
00:00 Homebrew Build With Different Arch?
00:46 Accepted Answer Score 6
01:09 Answer 2 Score 5
01:35 Answer 3 Score 3
01:55 Thank you

--

Full question
https://superuser.com/questions/331679/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #mac #homebrew

#avk47



ACCEPTED ANSWER

Score 6


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...




ANSWER 2

Score 5


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



ANSWER 3

Score 3


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