after hours I finally succeed in compiling SDL then zlib, libpng, jpeg and SDL_image, under devkitPSP
I tried the SDL example in "tests" folder from svn, then changed a bit to use SDL_image and I get a lots of error from SDL_image lib :/
$ make
psp-gcc -I. -I/c/devkitPro/devkitpsp/psp/sdk/include -O2 -G0 -Wall `/c/devkitPro /devkitpsp/psp/sdk/../bin/sdl-config --cflags` -L. -L/c/devkitPro/devkitpsp/psp /sdk/lib sdltest.o `/c/devkitPro/devkitpsp/psp/sdk/../bin/sdl-config --libs` - lSDL_image -ljpeg -lz -lpng -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk - lc -lpspuser -lpspkernel -o sdltest.elf
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG.o): In function `IMG_Load':
c:\devkitPro\devkitPSP\SDL_image/IMG.c:65: undefined reference to `SDL_RWFromFil e'
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o): In function `IMG_LoadB MP_RW':
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:196: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:197: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:198: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:199: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:202: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:215: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:216: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:217: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:218: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:219: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:220: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:221: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:222: undefined reference to `SDL_Read LE32'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:223: undefined reference to `SDL_Read LE32'
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o):c:\devkitPro\devkitPSP\ SDL_image/IMG_bmp.c:224: more undefined references to `SDL_ReadLE32' follow
c:/devkitPro/devkitPSP/psp/lib\libSDL_image.a(IMG_bmp.o): In function `IMG_LoadB MP_RW':
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:204: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:205: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:206: undefined reference to `SDL_Read LE16'
c:\devkitPro\devkitPSP\SDL_image/IMG_bmp.c:207: undefined reference to `SDL_Read LE16'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_reset_crc':
png.c:(.text+0x1b0): undefined reference to `crc32'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_calculate_crc':
png.c:(.text+0x1fc): undefined reference to `crc32'
png.c:(.text+0x228): undefined reference to `crc32'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(png.o): In function `png_reset_zstream':
png.c:(.text+0xb9c): undefined reference to `inflateReset'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_create_read _struct_2':
pngread.c:(.text+0x134): undefined reference to `inflateInit_'
pngread.c:(.text+0x27c): undefined reference to `inflateInit_'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_init_3 ':
pngread.c:(.text+0x4ac): undefined reference to `inflateInit_'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_row':
pngread.c:(.text+0xfbc): undefined reference to `inflate'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngread.o): In function `png_read_destro y':
pngread.c:(.text+0x1d24): undefined reference to `inflateEnd'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrtran.o): In function `png_build_gamm a_table':
pngrtran.c:(.text+0x1240): undefined reference to `pow'
pngrtran.c:(.text+0x1458): undefined reference to `pow'
pngrtran.c:(.text+0x1500): undefined reference to `pow'
pngrtran.c:(.text+0x1618): undefined reference to `pow'
pngrtran.c:(.text+0x16f4): undefined reference to `pow'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrtran.o):pngrtran.c:(.text+0x17e0): m ore undefined references to `pow' follow
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrutil.o): In function `png_decompress _chunk':
pngrutil.c:(.text+0x334): undefined reference to `inflate'
pngrutil.c:(.text+0x43c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x584): undefined reference to `inflateReset'
c:/devkitPro/devkitPSP/psp/lib\libpng.a(pngrutil.o): In function `png_read_finis h_row':
pngrutil.c:(.text+0x43d4): undefined reference to `inflate'
pngrutil.c:(.text+0x445c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x44a4): undefined reference to `inflateReset'
make: *** [sdltest.elf] Error 1
why ? since all the lib before compiled just fine :/
SDL_image
It's the same linker that Linux uses, but you generally don't see this problem when linking against shared libraries. When doing static linking as on the PSP, the linker goes in order and only includes objects found in each library if it needs them to solve an earlier dependency. You can repeat libraries or use --start-group and --end-group to satisfy cyclic dependencies or if you don't want to figure out the proper order.