could powerpc-gekko-cpp define GEKKO by default?

support for the powerpc toolchain
Post Reply
zimage
Posts: 3
Joined: Mon Feb 16, 2009 7:43 pm

could powerpc-gekko-cpp define GEKKO by default?

Post by zimage » Sun Feb 22, 2009 6:09 am

When I run cpp on a linux system, __linux, __linux__, and linux are all defined automatically

Code: Select all

$ touch /tmp/foo.c && cpp -E -dM /tmp/foo.c | grep linux
#define __linux 1
#define __linux__ 1
#define __gnu_linux__ 1
#define linux 1
On my mac they define __APPLE__

Code: Select all

$ touch /tmp/foo.c && cpp -E -dM /tmp/foo.c | grep APPLE
#define __APPLE_CC__ 5370
#define __APPLE__ 1
Could this be done with GEKKO being defined in powerpc-gekko-cpp? If someone could point me to the gcc source for devkitPPC, I'd be happy to supply a patch.

Cheers,
zImage

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: could powerpc-gekko-cpp define GEKKO by default?

Post by weirdfox » Sun Feb 22, 2009 7:19 am

When compilling for Wii, the define "GEKKO" will be used.
It's passed directly to the compiler (-DGEKKO) when running make.

See Wii make rules files : "path to your devkitPPC"/wii_rules
try, crash, debug and learn :)

zimage
Posts: 3
Joined: Mon Feb 16, 2009 7:43 pm

Re: could powerpc-gekko-cpp define GEKKO by default?

Post by zimage » Sun Feb 22, 2009 7:34 am

weirdfox wrote:When compilling for Wii, the define "GEKKO" will be used.
It's passed directly to the compiler (-DGEKKO) when running make.

See Wii make rules files : "path to your devkitPPC"/wii_rules
Yes, I know that. Software that has been written for platforms other than the wii doesn't include $DEVKITPPC/wii_rules in their Makefile though. It would be nice if cpp defined this automagicaly. I know, I could "export CPPFLAGS=-DGEKKO" before running "./configure --host=powerpc-gekko", but having it defined by cpp seems cleaner, since this define is what everyone seems to be using in the wii comunity. I just thought it would make porting and other things more convenient.

zimage
Posts: 3
Joined: Mon Feb 16, 2009 7:43 pm

Re: could powerpc-gekko-cpp define GEKKO by default?

Post by zimage » Sun Feb 22, 2009 8:12 am

I just looked at the patch to gcc and noticed that "__wii__" is defined when you use "cpp -mrvl". This is exactly what I'm looking for.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests