From: Brendan L. <che...@gm...> - 2010-06-08 05:12:10
|
Hi all, It's been a great day of hacking for a change, and libt4kcommon is looking good. I spent today getting it to link, but only with TuxMath, using CMake, under Linux (and technically MinGW too, but that's an act of masochism as usual). More delightful combinations to come with TuxType, autotools and OSX...as soon as I wrap my head around libtool, that is. Here's how to try out linking with t4kcommon: git clone git://git.debian.org/git/tux4kids/t4kcommon.git && cd t4kcommon mkdir build && cd build cmake .. make sudo make install For TuxMath git clone git://git.debian.org/git/tux4kids/tuxmath.git && cd t4kcommon git checkout commonification mkdir build && cd build cmake .. #ensure libt4kcommon is found - should show up in config.h make sudo make install tuxmath Bam! libt4kcommon linkage, like magic. You can't exactly tell, because the game runs just as normal, but it's there, using the shiny new T4K_DrawButton() instead of DrawButton(). If you have any doubt, try running the game after removing the library, and it should complain. Some remarks: The T4K_FuncName() prefix - These have been added to all functions that have so far made it into the library. I was a bit hesitant to do this mainly because it's a *lot* of renaming, but upon reflection, I think using them will not only be "good form," but also make the eventual transition period (where the functionality in question will be split between TuxMath, TuxType and libt4kcommon) a little less nightmarish: fewer name clashes, at the very least. Does anyone have strong feelings to the contrary? Tux4Kids-common vs. T4k-common vs. t4kcommon - a relatively minor issue, but one that's causing a few problems. For example, the CMake installation step currently takes t4k-common.h and renames it to t4kcommon.h when copied over. It seems to me we should stick with the first and third options--the first for things like titles and package naming, the third for files and shorthand. Not sure what kind of standards are in place here, or whether it matters at all, besides aesthetics. Any strong feelings either way? Build stability - hahaha! It's very flaky right now, both in terms of building libt4kcommon and linking to it from TuxMath. I have the feeling that builds on other environments will be still quite temperamental. Hopefully, by following the steps above, folks can help uncover a few things I've overlooked. (If not, though, I won't complain!) Thanks, and apologies for the long message. Best, Brendan |