All of lore.kernel.org
 help / color / mirror / Atom feed
* Confusion about autotools
@ 2014-04-10 23:43 Patrick Doyle
  2014-04-10 23:50 ` Chris Larson
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Doyle @ 2014-04-10 23:43 UTC (permalink / raw)
  To: yocto

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.

So now I'm confused.  Since this isn't working the way I thought it
would, I figured it was time (once again -- and thanks for all of the
help so far!) to ask the list how I should do this.

For purely hysterical reasons, the gst plugin is in the same (bzr)
repository and my yocto build environment.  I was expecting to write a
"do_fetch()" task that would copy the source files into the
appropriate location in build tree.

I guess I could create a subdirectory of the recipe that contains a
bunch of symbolic links to each of the source files required to build
the plugin, and list them all as file:whatever in SRC_URI.  But that
feels hackish.

Once again, any tips to help over this hump (and help me make it to
the big important demo next week) would be welcome.

--wpd


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Confusion about autotools
  2014-04-10 23:43 Confusion about autotools Patrick Doyle
@ 2014-04-10 23:50 ` Chris Larson
  2014-04-11  0:12   ` Patrick Doyle
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Larson @ 2014-04-10 23:50 UTC (permalink / raw)
  To: Patrick Doyle; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

On Thu, Apr 10, 2014 at 4:43 PM, Patrick Doyle <wpdster@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

[-- Attachment #2: Type: text/html, Size: 1834 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Confusion about autotools
  2014-04-10 23:50 ` Chris Larson
@ 2014-04-11  0:12   ` Patrick Doyle
  2014-04-11  0:15     ` Chris Larson
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Doyle @ 2014-04-11  0:12 UTC (permalink / raw)
  To: Chris Larson; +Cc: yocto

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@kergoth.com> wrote:
>
> On Thu, Apr 10, 2014 at 4:43 PM, Patrick Doyle <wpdster@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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Confusion about autotools
  2014-04-11  0:12   ` Patrick Doyle
@ 2014-04-11  0:15     ` Chris Larson
  2014-04-11  0:21       ` Patrick Doyle
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Larson @ 2014-04-11  0:15 UTC (permalink / raw)
  To: Patrick Doyle; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

On Thu, Apr 10, 2014 at 5:12 PM, Patrick Doyle <wpdster@gmail.com> wrote:

> 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.
>

It should show up in the do_fetch log (not the cooker log), which lives
next to the run script. That said, it's possible you're hitting an issue
due to the base.bbclass fetch implementation being python, not shell.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1346 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Confusion about autotools
  2014-04-11  0:15     ` Chris Larson
@ 2014-04-11  0:21       ` Patrick Doyle
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick Doyle @ 2014-04-11  0:21 UTC (permalink / raw)
  To: Chris Larson; +Cc: yocto

ok, thanks.

I do get a "Hello World" message out of do_unpack().  Weird.

Thanks.

--wpd


On Thu, Apr 10, 2014 at 8:15 PM, Chris Larson <clarson@kergoth.com> wrote:
>
> On Thu, Apr 10, 2014 at 5:12 PM, Patrick Doyle <wpdster@gmail.com> wrote:
>>
>> 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.
>
>
> It should show up in the do_fetch log (not the cooker log), which lives next
> to the run script. That said, it's possible you're hitting an issue due to
> the base.bbclass fetch implementation being python, not shell.
>
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-11  0:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-10 23:43 Confusion about autotools Patrick Doyle
2014-04-10 23:50 ` Chris Larson
2014-04-11  0:12   ` Patrick Doyle
2014-04-11  0:15     ` Chris Larson
2014-04-11  0:21       ` Patrick Doyle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.