Linux Game Development

Learning Kyra: Installing the New Version

I decided to install the latest version of the Kyra Sprite Engine since I am still so early in the Oracle’s Eye project. Historically, Kyra allowed you to dynamically link to the library, and so I had it installed on my system as any other library.

I wanted to install the latest version similarly. I found that the latest version doesn’t have a working configure file; I was expecting to be able to use the standard ./configure; make; make install. It still worked for the most part without the ./configure part. In fact I took advantage of checkinstall to create a nice Debian package for me so I can uninstall and install easily.

So it builds, but I found that there are a few differences. For one, kyra-config doesn’t exist. I normally used it to get the cflags and the lib arguments for my Makefile, similar to the way you would use sdl-config. So, how do you build a project now?

I asked on the Kyra forums, and the maintainer was actually just sitting in front of it waiting for my posts. He was that quick! Eventually I found that the way I wanted to use Kyra wasn’t the way it was supposed to be used anymore.

Kyra isn’t currently capable of being backwards compatible, meaning that different versions of the same library can’t be installed at the same time. So basically statically linking is easier and less likely to cause problems. My only concern is the fact that the LGPL license requires different things for code that statically links to it, but I was planning on releasing my code under the GPL anyway so it isn’t a huge problem.

To make one of my famously long stories short, I ended up working on my Makefile and the library until I found out how to get it to work dynamically…just in time to read that I shouldn’t use it that way. I managed to get my project to build with the new library only to find out that I should use it a different way. I spent some more time until I finally managed to get it to build the preferred way. I have a source directory with all of my source files as well as a subdirectory with the Kyra library source.

It was definitely a good learning experience, as I learned more about linking and libraries on my Gnu/Linux system. I actually built my project successfully three different times: once with the old dynamic library, once with the new library fixed up to be dynamic, and once with the code statically linked. The last option is actually cool because I can actually add the Kyra library directory to my Subversion repository for Oracle’s Eye.

Still, I would have liked to schedule my learning experiences better. I was supposed to be working on my game project instead of the supporting library. I really wanted to try to work on what William Willing mentioned on his blog about Composition vs Inheritance. I’ll probably be able to work on it this Friday though. At least the new library seems to be working great now.