首页 > 解决方案 > 作为 DEPENDS 提供的配方是否可以在 yocto 中有自己的 do_install() ?

问题描述

我正在尝试使用 Yocto (Rocko) 为我的基于 Linux i.MX6 的嵌入式系统构建自定义配方。主配方依赖于其他自定义配方(因为主配方使用此配方中的头文件),这也创建了一些需要包含在最终图像中的二进制文件。

我在 main_recipe.bb 的“DEPENDS”中添加了 other_recipe(nbdkit)

DEPENDS += "nbdkit"

主要配方是在它自己的源文件的帮助下创建一个 .so,其中包括来自“工具包”配方的头文件。我可以通过将其添加到 do_install() 中来安装使用此 main_recipe 生成的二进制文件和 .so。

现在在 other_recipe(nbdkit http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-support/nbdkit/nbdkit_git.bb?h=master ) 中,当我添加 do_install() 以包含从该配方生成的二进制文件 main_recipe 构建失败并出现 PKG_CONFIG 错误,如下所示,

| Package nbdkit was not found in the pkg-config search path.
| Perhaps you should add the directory containing `nbdkit.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'nbdkit' found

其他构建错误表示未找到 main_recipe 中包含的套件的头文件。

app-nbdkit-plugin.c:2:10: fatal error: nbdkit-plugin.h: No such file or directory

其中 app-nbdkit-plugin.c 是 main_recipe 的源文件,而 kit-plugin.h 是 other_recipe 的头文件。

奇怪的是,当我从 other_recipe(nbdkit) 中删除 do_install() 时, main_recipe 已成功构建。现在我怀疑,是否可以将一个配方设置为其他配方的依赖项,同时它提供输出文件作为 do_install()?从 other_recipe 到 main_recipe 共享头文件会解决问题吗?如果是,该怎么做?

谢谢。

[编辑] 添加了 nbdkit 配方链接。

标签: yoctorecipe

解决方案


推荐阅读