you can install things wherever you want ( keep in mind if you have more than one user, the other users will not be able to use things from you home directory unless you do some tinkering).
the PKG_CONFIG_PATH is an environmental variable that the program pkg-config uses to define it's search path for .pc files. if PKG_CONFIG_PATH is not set, it uses it's own defaults. when you install libraries that use pkg-config outside of /usr, you need to set the variable to include your new directories containing .pc files. there are different ways to set it, each differ on the order the directories are searched:
Code:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
this sets /usr/local/lib/pkgconfig as the
only directory searched
Code:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
this set /usr/local/lib/pkgconfig as the very first directory searched, notice the variable at the end with the $ in front, the $ will expand it out to whatever PKG_CONFIG_PATH contains
Code:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
notice on this one the variable is in front now, which will expand and add /usr/local/lib/pkgconfig to the end, making /usr/local/lib/pkgconfig the last directory searched.
in this case, the order is not important as long as you have the directory containing the .pc files somewhere in the path. later, if you decide you want to install conflicting versions of things, like say a gnome-2.8 installation and a gnome-2.10 installation on the same machine, the order of environmental variables becomes more important, as you can see above you can force the system to look in one place before another for what it wants, making it easy to force the system to ignore libraries or pick up certain sets of libraries before it finds older libraries. PATH, LD_LIBRARY_PATH, etc... work the same way.