I see. Well what I ended up deciding to do in the end was something like this instead of -Dmain=SDL_main:WinterMute wrote:There's a note in the SDL headers that you need to extern "C" your main to get it to work with C++, it's basically because it supplies it's own main that does some setup before running the user's main.
Code: Select all
#if ((defined(__wii__) || defined(__gamecube)) && !defined(main)) extern "C" int SDL_main(int argc, char **argv) #else int main(int argc, char* argv) #endif
They're so scared of it that they don't even attempt to provide an sdl-config script to put in .../devkitpro/devkitPPC/bin, and they dismiss out-of-hand and bug reports that make even a tangential mention of autotools/configure.I've been attempting to get the SDL wii guys to switch to using the autotools setup for years without much success. Sadly it seems to scare people which is a bit of a shame considering how well it works and how much work I put into the toolchain setup so it's possible to do with devkitPPC & devkitARM.
I find it confusing and intimidating too, but I was able to muddle through.
I know it's possible because I've seen some GP2X Wiz sources (the Wiz port of POWDER maybe? Possibly convenient since POWDER also has a Wii port) whose build process builds native tools that are used to do (pre)generate .h files or somesuch.I'm still not 100% sure how to deal with tools that are meant for the build system when you're cross compiling, often setting --host builds them for the target system instead which might lead to some problems with what you're porting.
In addition to --host, you probably need to feed configure your cross-compiling toolchain's include and library paths. This is done either via arguments or via environment variables (configure --help should tell you which it supports).You did inspire me to have a look at using configure && make to build wii SDL though, I've managed to get it to build & install but I'm not yet sure if I've managed to get all the changes that were done for wii. I'm trying to figure out how to get the configure for the tests to ignore build system libraries atm. Right now it's decided to pick up openGL which is a bit annoying.