Changes

Jump to navigation Jump to search
== Cross-compiling for PPC on Intel Mac ==
 
I see that Mojca has left homework for me to do over the week-end <code>;-)</code> so here goes:
 
In order to cross-compile for PPC on a Intel Mac, you need to give the compiler and the linker the following additional switches:
 
-arch ppc
 
Pretty damn simple, isn't?
 
So all you have to do is set <code>CFLAGS</code> and <code>LDFLAGS</code> before you run <code>configure</code> (as well as <code>CXXFLAGS</code>, if applicable). Of course it may be that some Makefiles don't honor these variables and override them with something of their own, and this is the major inconvience you will have to deal with (this is actually what the Makefile for lua does; here you would have to set something like <code>MYCFLAGS</code> or <code>XCFLAGS</code> in addition).
 
Obviously, you can also use a similar instruction to cross-compile the other way round (build for Intel on a PPC host); it's called <code>-arch i386</code>; and if you give both at the same time, it results with a so-called ''universal'' binary (the size of which being approximately the sum of the size of both individual binaries). [[User:Arthur|Arthur]] 17:20, 30 September 2007 (CEST)
45

edits

Navigation menu