大概所有的yocto人都知道yocto rocko 2.4+中sysrootfs策略已更改。因此,我遇到以下问题:我尝试使用makefile为共享库制作配方。配方如下(我不声称它是完整的。我只是无法通过构建阶段):
#==================
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${THISDIR}/files/LICENSE;md5=5959e502cb44bafc53b2cc9400e3d4cd"
PR = "r0"
##### First try from my local repo and then we will use the big one
SRC_URI = "git:///home/w23698/projects/anybus/Generic;branch=anybus-lib-0.0.1"
SRCREV = "2fe4ce39a651d71f3f8de1c751dff2581de2c526"
S = "${WORKDIR}/git"
PACKAGES = "${PN} ${PN}-dev ${PN}-dbg"
#####The only dependency
RDEPENDS_${PN} = "libgpiod"
RDEPENDS_${PN}-dev = "libgpiod"
RDEPENDS_${PN}-dbg = "libgpiod"
do_compile() {
oe_runmake
}
do_install() {
install -d ${D}${libdir}
install -m 0644 ${PN}-m40 ${D}${libdir}
}
失败后,我感到惊讶的是
ww.c:6:10: fatal error: gpiod.h: No such file or directory
| #include "gpiod.h"
| ^~~~~~~~~
| compilation terminated.
然后我注意到命令行是:
arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/<full path>/recipe-sysroot -L/usr/lib -g -Wall -fpic .....
我查看了recipe-sysroot/usr/lib/
,发现最小的库集和libgpiod都不存在。标头中都没有include ...
有什么建议吗?
答案 0 :(得分:1)
您从未设置DEPENDS = libgpiod。
您设置的RDEPENDS是运行时所依赖的,因此与编译时无关。您只需删除这些链接,因为库链接依赖关系将自动生成。