From: David B. <dav...@gm...> - 2011-02-09 20:06:51
|
Hi Volker, That helps a lot - I just want to make sure I understand correctly. > 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). 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. Thanks a ton - David t4k_common.pc.in: ---------------------------------------------------- # Process with configure script to generate t4k_common.pc file for pkg-config # NOTE: we rely heavily on substituted output variables from Autoconf # or Cmake to generate a t4k_common.pc that reflects conditional build # with optional libraries. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: @PACKAGE_NAME@ Description: Tux4Kids common routines Version: @VERSION@ # List needed libs that have *.pc files in "Requires:" Requires: @T4K_COMMON_DEP_PKGS@ # List libs "by hand" that don't have .pc files: Libs: -l@PACKAGE_TARNAME@ -L${libdir} @T4K_COMMON_DEP_LIBS@ Cflags: -I${includedir} # List secondary dependencies of libs that don't have *.pc files # (needed for static linking) Libs.private: @T4K_COMMON_DEP_LIBS_PRIVATE@ |