From: David B. <dav...@gm...> - 2011-01-12 21:47:21
|
Hi Aviral, Since we spoke, I've learned a few things. Mainly, there is an autoconf m4 macro intended for autoheader use within libraries (ax_prefix_config_h.m4), that creates the autoheader stuff with a prefix to avoid a "config.h" name collision. I added this to t4k_common, so now our autoheader file is called "t4k_common-config.h", and similarly we have e.g. "T4K_COMMON_HAVE_SCANDIR". I also changed our replacement alphasort() slightly so that the function signature would match that in /usr/include/dirent.h. After these changes, the autotools build appears to work fine. In particular, there are no errors with a subsequent tuxmath build that uses the new t4k_common. So, autoconf is definitely supposed to be able to support the kind of platform-specific function compilation that we want. Regarding cmake, I had spent some time adding the checks for scandir and alphasort, but still had a problem in that the resultant config.h didn't seem to be located by the compiler/linker. Strangely, after working on the above autotools fix, the cmake build now appears to work without problems. I have definitely not modified cmake to add a prefix to config.h like I did with autoconf. Any attention from the cmake gurus out there would be most welcome. Importantly, I have not yet tested t4k_replacements.c in a build for a platform that lacks scandir/alphasort, to confirm that the replacement procedure actually works. I will try to test the mingw-cross-env crossbuild with the latest t4k_common as soon as I can. Best, David |