Page 1 of 1
could powerpc-gekko-cpp define GEKKO by default?
Posted: Sun Feb 22, 2009 6:09 am
by zimage
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
Re: could powerpc-gekko-cpp define GEKKO by default?
Posted: Sun Feb 22, 2009 7:19 am
by weirdfox
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
Re: could powerpc-gekko-cpp define GEKKO by default?
Posted: Sun Feb 22, 2009 7:34 am
by zimage
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.
Re: could powerpc-gekko-cpp define GEKKO by default?
Posted: Sun Feb 22, 2009 8:12 am
by zimage
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.