Re: gtk



On Aug 7, 2006, at 11:35 AM, Tor Lillqvist wrote:
Bill Cunningham writes:
pkg-config doesn't help me much. I'm not quite sure how to use it. I
know there is the PKG_CONFIG variable. Do you set that in bash_profile ? I
must confess I can't figure out how to use the package.

You don't really use pkg-config directly; the configure scripts for what you're installing use it. You merely provide some external direction for it.

Basic idea: packages provided pkg-config files (for example, gtk +-2.0.pc). These files tell pkg-config how to tell the build system for another package how to build and link against the first package. Now, to find those files, pkg-config must know where they are. They're installed to $PREFIX/pkgconfig by packages. So, if glib is installed in /opt/gtk2, and you want to link GTK against that glib, you'd run GTK's configure script like so:

$ PKG_CONFIG_PATH="/opt/gtk2/lib/pkgconfig:$PKG_CONFIG_PATH" ./ configure <configure args as normal>

thereby setting the environment variable on the command line. Optionally, you can set it in your .bashrc, .bash_profile, or whatever the initialization script for your shell is.

- Michael

P.S. Hit Reply to All rather than Reply to keep the discussion on the list and avoid the problem Tor's brought to your attention.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]