Home > Programming > Get CFLAGS for a Package with pkg-config

Get CFLAGS for a Package with pkg-config

As I tried to cross-compile an application that required glibconfig.h, I found a way to retrieve the CFLAGS for a given package.

Here’s the output for glib-2.0 and gtk-2.0 in qemu for overo:

pkg-config –cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include

pkg-config –cflags gdk-2.0
-pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabi/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1

Finally, I found out that glibconfig,h was in /usr/lib/arm-linux-gnueabi/glib-2.0/include as this file is generated by configure and is platform dependent.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. No comments yet.
  1. No trackbacks yet.