[poky] recipe gtk program include directories

Richard Purdie richard.purdie at linuxfoundation.org
Mon Feb 28 08:12:46 PST 2011


On Mon, 2011-02-28 at 15:49 +0100, Gerard van den Bosch wrote:
> I have created a simple program with GTK and now I want to add it as a 
> package in poky.
> Because it is a single C file I have constructed the following recipe:
> 
> DESCRIPTION = "Battery indication"
> SECTION = "examples"
> LICENSE = "GPL"
> DEPENDS = "gtk+"
> 
> SRC_URI = "file://image.c"
> 
> S = "${WORKDIR}"
> 
> do_compile() {
>      ${CC} image.c -o image
> }
> 
> do_install() {
>      install -d ${D}${bindir}
>      install -m 0755 image ${D}${bindir}
> }
> 
> Now I have the problem that on my ubuntu computer I normally add 
> `pkg-config --libs --cflags gtk+-2.0` to the gcc compile line to include 
> the right directories.
> 
> But I don't understand how to do this in a recipe, can someone point me 
> to an example or explain how this is done?

Can't you just add that to the do_compile line as you'd usually do, e.g:

do_compile () {
    ${CC} image.c -o image `pkg-config --libs --cflags gtk+-2.0`
}

? (and add pkgconfig-native to DEPENDS)

Cheers,

Richard




More information about the poky mailing list