Cross compile guidelines

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Cross compile guidelines

Post by jockyw2001 »

Disclaimer: I just started developing homebrewn for PSP so plz apologize for possibly asking a n00b question.

I try to cross compile several libraries (libogg, samba, ...) which is usually rather trivial on other platforms. Either by feeding 'configure' the right options to generate a working Makefile or by making some straightforward changes in a Makefile you can build most of the stuff w/o too many worries. PSP seems to be a bit more difficult. I have trouble finding a systematic approach to cross compile packages for PSP.

Can you help me? Thx!

/JockyW
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Re: Cross compile guidelines

Post by jimparis »

The PSP is not a Unix system, and the pspsdk is not POSIX compliant. It's close in some places, but you can't expect to just take any code that compiles fine on a POSIX system and have it work. For example:
  • pspsdk uses newlib, which lacks some of glibc's features and headers.
  • libc is not linked by default, so typical autoconf tests will fail to build
  • autoconf knows nothing about the PSP
  • defining PSP_MODULE_INFO and running psp-fixup-imports on the executable are required, otherwise it won't run
You should look at all of the other libraries and programs that have been ported (in the psp and pspware repositories). All SDL libs use autoconf, for example.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Thanks jimparis!

Yes, studying build.mk, the samples and the stuff in the svn trunk helps understanding. I will port things case by case. If stuff works I'll fwd it to the devs for checking it in svn.

/JockyW
Post Reply