[yocto] Confusion about autotools

Patrick Doyle wpdster at gmail.com
Thu Apr 10 17:12:51 PDT 2014


ok, that makes sense.  Trying to pattern match against too many
patterns, and not spending enough time understanding the underlying
technology.  Thank you for the explanation.

If you don't mind, I'll move on to my next question...

I now have a "do_fetch()" task that looks like this:

do_fetch () {
bberror "Hello World"
exit 1
}

Where would I see "Hello World" pop out?  I don't see it in the log file.

I do see in run.do_fetch a shell script that looks like:
...
do_fetch() {
bberror "Hello World"
exit 1

}

bberror() {
echo "ERROR: $*"

}

cd '/home/wpd/yocto/downloads'
do_fetch

That's cool... things are starting to make sense now.  Especially as I
see that "do_fetch()" is probably not the right task to overload.

But I do wonder what happened to my "Hello World" message.

--wpd


On Thu, Apr 10, 2014 at 7:50 PM, Chris Larson <clarson at kergoth.com> wrote:
>
> On Thu, Apr 10, 2014 at 4:43 PM, Patrick Doyle <wpdster at gmail.com> wrote:
>>
>> I am trying to write a recipe for a custom gstreamer plugin that
>> compiles fine (natively) with autotools.
>>
>> I thought it would be as simple as writing a recipe that said something
>> like:
>>
>> inherit autotools
>>
>> myplugin_do_fetch() {
>>     commands_to_make_a_copy_of_my_source_code_in_build_tree;
>> }
>> EXPORT_FUNCTIONS do_fetch
>>
>> (I am leaving out the boilerplate DESCRIPTION, LICENSE, etc...
>>
>> But when I try to run my recipe, I get an error that ends like:
>>
>> 109: /home/wpd/.../run.do_fetch.1234 do_fetch: not found
>>
>> and when I look at run.do_fetch, I see on line 109
>>
>> do_fetch
>>
>> I thought that do_fetch would be inherited from base.bbclass.  I look
>> in autotools.bbclass and I don't see a do_fetch function task defined
>> there.
>
>
> EXPORT_FUNCTIONS is an inheritance mechanism, to let you override a function
> in a class you inherit but still be able to explicitly call the function
> defined by that class. Unless you have a 'myplugin' class, nothing will
> translate myplugin_do_fetch to do_fetch. If you want to override a function
> like do_fetch in your recipe, just override that function, don't prefix it.
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics



More information about the yocto mailing list