[poky] recipe gtk program include directories

Gerard van den Bosch gerard at de-haardt.com
Mon Feb 28 23:32:23 PST 2011


On 02/28/2011 05:12 PM, Richard Purdie wrote:
> 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
>
Thanks, adding pkgconfig to the DEPENDS and adding the line I usually 
add solved the problem. I also had to rename the file from image to 
something else because the do_install created a folder image and 
overwrite my compiled image file.
But now it compiles and installs :).

Regards,
Gerard




More information about the poky mailing list