From: Volker G. <vo...@no...> - 2011-02-09 00:20:26
|
David Bruce schrieb: > I think the problem is in t4k_common's pkg-config file, > t4k_common.pc.in (reproduced below). My knowledge of pkg-config is > limited, but looking at the file it's pretty clear that I hard-coded a > dependency on SDL_ttf into the "Libs" section. t4k_common's build > process can detect if SDL_Pango is available, but the problem comes in > with the static linking needed for the mingw-cross-env build. For > static linking, t4k_common needs to supply all the compiler arguments > for all the dependencies, and this only works "automagically" for > dependencies that themselves have pkg-config *.pc files. Note that a *.pc file can "Require" another package. The idea is that you don't have to specify anything but your own stuff in the "Libs" section. However, this works only for dependencies that provide a *.pc file. All other libs you'll have to specify in your "Libs.private" section. (which will only be used for static builds, in contrast to "Libs") > I haven't > figured out how to write a *.pc file that conditionally passes the > arguments for either SDL_Pango (plus its deps) or SDL_ttf (plus deps) > to the tuxmath linking step. This is not a question of pkg-config. It is a question of Autoconf. If you collect some helper variables during the checks in configure.ac, you can simply include those variables in your *.pc.in file. (something like @DEP_PKGS@, @DEP_LIBS@) In general, I recommend to check for each library whether it is available via pkg-config. If it isn't, try something like AC_CHECK_LIB as a workaround. PKG_CHECK_EXISTS([...], PKG_CHECK_MODULES([...], AC_CHECK_LIB(...) ) One final thought: Nowadays almost all libraries ship with *.pc files. However, some distributions like Debian don't install those, maybe because their build scripts were written in a time where those libraries didn't provide a *.pc file. I think it would be a good idea to provide bug reports for those distributions, but I didn't yet find the time to do that. Any volunteers? Greets, Volker -- Volker Grabsch ---<<(())>>--- |