Jump to content
  • Advertisement
Sign in to follow this  
wyrzy

Configuring GCC to Cross-Compile

This topic is 4978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is kind of a shot-in-the-dark, but before I basically give up, I was wondering if anyone knows how to configure GCC to cross-compile for the G4/G5 power processor. What I'm trying to do is compile a game (made with SDL and strictly written using cross-platform code) for Mac OS X which primarily runs on G3/G4/G5 processors. I have seen articles explaining setting up GCC to cross-compile for other processors (even here on gamedev: http://www.gamedev.net/reference/articles/article1368.asp), so I figure it can be done, but I'm not sure how much trouble its worth. I'd really like my game to run on MacOSX as I know some people (over the net - could not actually use their computer) that might like to play it and use OS X. I've searched google with no luck, but if anyone has an idea as to where I would start, I would appreciate any recommendations. I am currently running Windows, but I have set up Linux (Debian and SUSE) on my computer once before, so if it would be easier to cross-compile for the G4/G5 on Linux I could do that as well. I'm not looking for anyone to completely explain the process (as it may be long), but possibly a start. I'm willing to spend a week or two trying to set it up, but if that doesn't work, I think I'll make the game PC only. I've tried PearPC btw (the G3 PowerPC emulator for x86), but I didn't have much luck.

Share this post


Link to post
Share on other sites
Advertisement
I *THINK* you need a special GCC version that targets that CPU, the default being X86.
You should go to their mailing list and ask questions there.

Share this post


Link to post
Share on other sites
Use Linux for compilation, forget about building a cross compiler under windows.

I am assuming you have set up a local gcc configuration.

Now download the newest source of binutils and gcc from ftp.gnu.org and untar them.

Then compile binutils:

./configure --target=powerpc-apple-darwin
make all

and as superuser:

make install


Then you should have a working version of binutils for the powerpc in your /usr/local/bin folder.


Similar for gcc:

./configure --target=powerpc-apple-darwin --enable-languages=c,c++
make all

and as superuser:
export PATH=$PATH:/usr/local/bin
make install


You probably need to compile the libraries as well.

Share this post


Link to post
Share on other sites
nmi: Thanks for the reply - I'll try what you suggested.

Raduprv: I probably should be asking at the gcc site/mailing list. I'll do that if I can't get nmi's suggestion to work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!