Page 1 of 1

How to build 3rd party libraries under devkitPro

Posted: Sat Feb 21, 2009 5:27 pm
by carlwang
Hello, guys.
I need to build some open source libraries to help to make my homebrew games.
Basicly, I just need to run ./configure and make on Linux.
But it doesn't work in devkitPro.

The error:

Code: Select all

no acceptable C compiler found in $PATH 
It's really necessary to use libraries to help us work.
So please give me a hand... any suggestion would be nice.

Re: How to build 3rd party libraries under devkitPro

Posted: Sun Feb 22, 2009 7:28 am
by weirdfox
Am I correct, you are trying to compile your external library with devkitpro ??

If yes, as devkitARM don't use autoconf, the part with autoconf's "configure" script won't work.
You will need to write the custom makefiles to compile the library as compiling for linux is different than compiling for devkit's ARM target.

Take the makefiles from the templates (in the examples) and customize them to fit the library. But usualy, some patching will be required on the lib.

Just out of curiosity, which library are you trying to compile ?

Re: How to build 3rd party libraries under devkitPro

Posted: Sun Feb 22, 2009 8:56 am
by carlwang
weirdfox wrote:Am I correct, you are trying to compile your external library with devkitpro ??

If yes, as devkitARM don't use autoconf, the part with autoconf's "configure" script won't work.
You will need to write the custom makefiles to compile the library as compiling for linux is different than compiling for devkit's ARM target.

Take the makefiles from the templates (in the examples) and customize them to fit the library. But usualy, some patching will be required on the lib.

Just out of curiosity, which library are you trying to compile ?
Thank you very much. You've got what I mean.
I'm going to compile any 3rd party libraries just in case. I work on Win32 basicly so I'm not so familiar with ARM platform.
But since we use msys, why can't we use ./confiure and sth. like that?

Re: How to build 3rd party libraries under devkitPro

Posted: Sun Feb 22, 2009 8:53 pm
by WinterMute
weirdfox wrote: If yes, as devkitARM don't use autoconf, the part with autoconf's "configure" script won't work.
You will need to write the custom makefiles to compile the library as compiling for linux is different than compiling for devkit's ARM target.

Take the makefiles from the templates (in the examples) and customize them to fit the library. But usualy, some patching will be required on the lib.
This is incorrect, there is no reason why autoconf won't work with devkitARM.

Depending on the library you want to cross compile, the configure step can be as simple as

Code: Select all

PATH=$DEVKITARM/bin:$PATH
./configure --host=arm-eabi --prefix=$DEVKITPRO/portlibs/arm
make && make install
To make use of the newly installed library you need to add $DEVKTPRO/portlibs/arm to the LIBDIRS variable in the template makefiles then use the headers and libs as normal. I've chosen this directory since many libraries could be used for all targets supported by devkitARM where there is no hardware specific code. For a library which needs to be tailored directly to the DS I would use $DEVKITPRO/libnds for the prefix.

Re: How to build 3rd party libraries under devkitPro

Posted: Mon Feb 23, 2009 5:26 am
by weirdfox
WinterMute wrote: This is incorrect, there is no reason why autoconf won't work with devkitARM.
Thanks WinterMute for pointing that out, I didn't knew about the --host param for autoconf.

That might really be useful for my next projects.

Another thing, do you have to specify that you want to compile as a static lib or autoconf should figure that out by itself ?

Re: How to build 3rd party libraries under devkitPro

Posted: Mon Feb 23, 2009 6:45 pm
by WinterMute
Generally I've found that most libraries default to static when cross compiling but adding --disable-shared --enable-static should work if you have trouble.

Re: How to build 3rd party libraries under devkitPro

Posted: Thu Feb 26, 2009 3:50 pm
by carlwang
./configure ok
make ok
cool!
tomorrow I'll have a try to link the lib :)
thank you guys