Dingoonity.org

GCW Zero => Development => Topic started by: David Knight on September 14, 2014, 08:06:59 pm

Title: Compiling libraries for gcw0
Post by: David Knight on September 14, 2014, 08:06:59 pm
I'm trying to compile wesnoth for gcw0. It needs libfontconfig which I can compile for gcw. The problem is that I don't know how to link the compiled .la file with wesnoth.

I understand that I should create a static library (.a) as opposed to a shared library (.so). Is this correct?
If so, how do you use libtools to do this?  When I check the .libs directory it contains no .a files, only .la and .so.
I've tried googling and am struggling to understand how to do this.

Sorry for this noob developer question but it's stopping me from compiling a number of apps!
Title: Re: Compiling libraries for gcw0
Post by: pcercuei on September 15, 2014, 08:36:10 am
Just compile fontconfig and install it inside the toolchain:
Code: [Select]
./configure --prefix=/usr --host=mipsel-linux
make
make install DESTDIR=/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot

Then you will be able to compile programs that use it.
I don't recommend to compile statically, it's generally not a good idea. Instead, you can put the .so of the libraries you just compiled in the OPK if they are not already in the rootfs, and set the library search path accordingly on the Exec line of your .desktop:
Code: [Select]
Exec=env LD_LIBRARY_PATH=. ./myapp
Title: Re: Compiling libraries for gcw0
Post by: David Knight on September 15, 2014, 09:52:41 pm
Thanks, this works great  ;D
Title: Re: Compiling libraries for gcw0
Post by: Scoobysnaxx on September 16, 2014, 05:59:24 pm
wesnoth?!!! Sweeet!  :)