|
|
 |
|
 |
|
Developer's Journal #01 - Converting to Autotools - February 23, 2006 11:23 GMT-8
Posted by Chris In the first issue of the Epiar Developer's Journal, I'll briefly discuss my experiences converting the Epiar source code to use the GNU autotools packages (which then enables us to do the standard ./configure, make, make install). Besides universal usability and the ease for people to now compile Epiar on multiple platforms this way, it also enables us to use GNU gettext, which pretty much needs the autotools' generated config.h to know which language to use.
If all these changes go well, we'll be able to provide translations in other languages. All translation contributions are welcome, but right away we hope to offer both English and German, being the two major languages of our players.
The large problem with GNU autotools is in the way we already organize our source code. In Epiar, the source code is organized by placing all the code under the src/ directory, and then from there we divide it up again into logical sections. So, for example, src/system/ contains system-related things (like initializing the video mode, setting up debugging facilities, etc.). src/ai/ on the otherhand, contains AI code, like how to perform manuevers, which variables to consider when making decisions, etc. On a minor side note, src/ai/ is expected to change dramatically as we make the shift over the scripted AI (like a real game would use) with Lua (www.lua.org, great, fast, ANSI C scripting language already popular with game developers).
The most common way of handling this little issue of subdirectories in subdirectories, according to GNU documentation, is to make anything in a sub-subdirectory (like anything in src/ai/) into a static library, like libai.a, and then link it against the main code. I spent two hours converting all the autotools files over to do this, only to discover that our sources don't depend on each other in a linear fashion; and a minor interesting thing about GNU GCC is that when using static libraries, all dependancies on a library must be specified on command line before that one, so if libvideo.a needs code from libsystem.a, you have to say: gcc libsystem.a libvideo.a, and not the other way around. Sadly, much of Epiar's code works like this: libsystem.a needs code from libvideo.a, but libvideo.a also needs code from libsystem.a. There is a workaround which I hope to implement tonight, but for now the Epiar CVS is very much broken.
For the next journal entry, expect something about the pros and cons and implementation experience of using Lua scripting to script the AI in Epiar. Thanks for reading.
| |
 |
|
 |
|
Copyright © 2002-2008 Entropy Development Studios. All Rights reserved. |
|
|