From: Volker G. <vo...@no...> - 2011-02-10 02:43:08
|
David Bruce schrieb: > Hi Volker, > > > 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@) > > Thanks - so I've created the following: > T4K_COMMON_DEP_PKGS - for needed libs that have *.pc files > T4K_COMMON_DEP_LIBS - for needed libs without *.pc files > T4K_COMMON_DEP_LIBS_PRIVATE - for secondary dependencies incurred by > libs without *.pc files. > > So the t4k_common.pc.in is now very simple (see below). Your solution is quite close to what I had in mind. However, I would change two things: 1) drop the 'T4K_COMMON_' prefix, as the other names are already unambiguous within a single project. 2) is the DEP_LIBS (aka T4K_COMMON_DEP_LIBS) variable really necessary? As long as you produce a shared library, there is no need to explicitly specify the dependency libs. I think you can safely put all non-*.pc libraries together with its secondary dependencies into DEP_LIBS_PRIVATE. Note that I assume in 2) that your library is created as a shared library. However, if it is really always linked statically, in mingw-cross-env as well as all other toolchains, then your approach is correct. BTW, in mingw-cross-env (i686-pc-mingw32-pkg-config) the --static flag is always provided, so Libs.private is always used. > For now, I've just hard-coded the previous values into these variables > within configure.ac to be sure the substitution is working as > intended, so the build isn't yet any smarter than before. So, if I > make sure these variables correctly track the configure options (e.g. > SDL_Pango vs. SDL_ttf, SDL_net vs no network support, etc.), this > should work as intended, if I understand correctly. Yes, that's the idea. The strategy I described here is used but a lot of other libraries. You might want to have a look at the *.pc.in files of other packages like cURL or GTK. Those will give you some more ideas about how to manage these things. Greets, Volker -- Volker Grabsch ---<<(())>>--- |