For this week’s Thousander Club update:
Game Hours: 409.25(previous two years) + 6 (current year) = 415.25 / 1000
Game Ideas: 710 (previous two years) + 0 (current year) = 710 / 1000
I found that my build scripts were broken for the game. You know how if you leave a Nintendo controller out long enough that the cable somehow gets itself tangled? I always wondered how it happened. Now I wonder how the heck my code stopped working since it isn’t as if I changed anything to break it. Whatever. I set to work fixing it.
To build my game, I am building custom versions of libraries, such as libSDL and Kyra. Rather than use my system’s installed libraries, I want to be able to distribute my game without the player needing to worry about dependencies. To make the download size smaller, I was building the libraries so that only what I needed for my game was compiled. For instance, libSDL didn’t need to load BMP or TGA files since I was only using PNGs. To build these libraries and make sure they installed into my project’s subdirectory instead of into my system, I had to pass the install path name into the configure script.
It turned out that the build scripts were hardcoded to pathnames on my desktop. Now, we all know hardcoding things is bad, so why did I do it? Well, it turns out that you can’t pass relative paths into a configure script. They had to be absolute paths. I needed to pass “/home/gberardi/Projects/foo/lib” instead of “../../lib”.
So since I was just trying to build my game as quickly as I could, hardcoding it was fine. Since I started building it on my laptop, however, the directories I kept my projects in were different, and I had problems.
In a few hours, I learned more about using GNU Make, specifically how to pass around variables from one makefile to another. Now I can get the absolute pathname of the project, and using that, I can pass it around to subdirectory makefiles, which can then specify other subdirectories. Also, if I use any machine to build the project, it should work without a hitch.
Now I just need to get the game to build. Kyra is a real pain to deal with because the original maintainer did not keep the build scripts working for it. You cannot configure && make && make install. Or at least you couldn’t, until I learned about autoconf and automake enough to get it to work last year. Unfortunately, it turns out that I’ll need to jump into it again because it copies over most header files into the install directory, but not all of them. I’m sure it won’t take much to change the build to copy those files, too, but it might take me some time to figure out how to do it. In a pinch, I can hack a small script to copy those files separately from Kyra’s build, but it would be nice to have the library act self-sufficiently.
Kyra is just a tool, of course, and as nice as it has been, it may be best to switch to a much better supported tool, such as Allegro. Once I finish v1.0 of Killer Kittens from Katis Minor, I’ll make an effort to switch libraries. For now, I just need to get to 1.0.
EDIT: Oh, it turned out to be easier than I thought. Makefile.am just needed to be edited to tell it how to create the files, then automake needed to run to generate the Makefile.in. Simple. Now my game builds and runs just fine, which means my real work can begin in earnest.