How to build 3rd party libraries under devkitPro

support for the ARM toolchain
Post Reply
carlwang
Posts: 3
Joined: Sat Feb 21, 2009 5:14 pm

How to build 3rd party libraries under devkitPro

Post by carlwang » Sat Feb 21, 2009 5:27 pm

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.

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: How to build 3rd party libraries under devkitPro

Post by weirdfox » Sun Feb 22, 2009 7:28 am

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 ?
try, crash, debug and learn :)

carlwang
Posts: 3
Joined: Sat Feb 21, 2009 5:14 pm

Re: How to build 3rd party libraries under devkitPro

Post by carlwang » Sun Feb 22, 2009 8:56 am

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?

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: How to build 3rd party libraries under devkitPro

Post by WinterMute » Sun Feb 22, 2009 8:53 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

weirdfox
Posts: 29
Joined: Thu Feb 19, 2009 8:45 am
Location: Montreal, Canada
Contact:

Re: How to build 3rd party libraries under devkitPro

Post by weirdfox » Mon Feb 23, 2009 5:26 am

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 ?
try, crash, debug and learn :)

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: How to build 3rd party libraries under devkitPro

Post by WinterMute » Mon Feb 23, 2009 6:45 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

carlwang
Posts: 3
Joined: Sat Feb 21, 2009 5:14 pm

Re: How to build 3rd party libraries under devkitPro

Post by carlwang » Thu Feb 26, 2009 3:50 pm

./configure ok
make ok
cool!
tomorrow I'll have a try to link the lib :)
thank you guys

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests