Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rabidz7

macrumors 65816
Original poster
Jun 24, 2012
1,205
3
Ohio
How do i choose the architecture I compile an app for? e.g. ppc, ppc64, i386, i386_64
 

karter16

macrumors member
Aug 26, 2012
60
3
Auckland, New Zealand
So, do I do this when i type ./configure or make?

Hmmm it's a bit difficult to say without knowing exactly what you are doing.

it might pay to do some background reading on gcc, option flags, makefiles, etc. but essentially -arch is an option for gcc, which is what compiles your source code.

You need to add -arch (and your chosen architecture) to the relevant gcc calls. Without knowing your setup this is probably in the configure file or possibly directly in the makefile (although I'm guessing the way you have things setup configure is building your makefile). Anyway, I'd suggest doing background reading on whatever your workflow is so that you understand each step of what is happening :)

Cheers

----------

Starting with something like this could be useful :)

http://www.eupcs.org/wiki/Introduction_To_Makefiles
 

rabidz7

macrumors 65816
Original poster
Jun 24, 2012
1,205
3
Ohio
clarification

Hmmm it's a bit difficult to say without knowing exactly what you are doing.

it might pay to do some background reading on gcc, option flags, makefiles, etc. but essentially -arch is an option for gcc, which is what compiles your source code.

You need to add -arch (and your chosen architecture) to the relevant gcc calls. Without knowing your setup this is probably in the configure file or possibly directly in the makefile (although I'm guessing the way you have things setup configure is building your makefile). Anyway, I'd suggest doing background reading on whatever your workflow is so that you understand each step of what is happening :)

Cheers

----------

Starting with something like this could be useful :)

http://www.eupcs.org/wiki/Introduction_To_Makefiles


A am compiling an app from source code on my macbook pro 2011. I first type ./configure then I type make.
 

karter16

macrumors member
Aug 26, 2012
60
3
Auckland, New Zealand
A am compiling an app from source code on my macbook pro 2011. I first type ./configure then I type make.

Yep - so you need to edit your makefile to contain the arch option when GCC is called.

I really, really recommend reading up on makefiles etc. so you understand what's going on :)

Good luck!
 

mfram

Contributor
Jan 23, 2010
1,307
343
San Diego, CA USA
Usually you'd say something like

Code:
./configure --help

It will tell you the options available. It might be something like:

Code:
./configure --with-cflags="-march=i386"

or something like that. Every package is different.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
One way to do it is with
Code:
./configure --with-cflags="-arch i386" --with-ldflags="-arch i386"
or with
Code:
CC="gcc -arch i386" ./configure
The arch flag is specific to Darwin/OS X/NeXTStep and won't work on other OSes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.