如何将静态库添加到Yocto SDK包

时间:2019-03-20 08:11:10

标签: sdk static-libraries yocto

我有一个.a和.h文件,应将其添加到SDK安装程序中。头文件已正确放置在{includedir}或/ usr / include

但是,出于某种原因,设置为添加到{libdir}中的静态lib文件不会复制到usr / lib /中。构建SDK软件包时,我没有收到任何错误或警告消息。

使用的食谱:

B

请不要介意externalsrc或任何其他与问题无关的特性,除了未将静态lib插入SDK之外,该配方可以按我需要的方式正常工作。

为什么.a文件与头文件的处理方式不同,如何更改配方,以便将静态库包含在SDK包中?

列出包裹时,我得到:

#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#

SUMMARY = "HostSw and libraries for abc"
SECTION = "abc-drv"
LICENSE = "CLOSED"

ABC_ROOT = "${HOME}/abc/def"
ABC_HOSTSW_DIR = "${ABC_ROOT}/hostSw"
ABC_UTILS_DIR = "${ABC_ROOT}/cliUtilities"

inherit externalsrc
EXTERNALSRC = "${ABC_ROOT}"


do_compile() {
  make clean -C ${ABC_HOSTSW_DIR}
  make -C ${ABC_HOSTSW_DIR}

  make clean -C ${ABC_UTILS_DIR}
  make -C ${ABC_UTILS_DIR}
}

##################################################################################################

APPLI_PATH            := "${ABC_ROOT}/hostSw"
APPLI_BIN_PATH        := "${APPLI_PATH}/bin/"
APPLI_TARGET_PATH     := "${base_prefix}/home/root/"
APPLI_NAME            := "example-app"
UTILS_BIN_PATH        := "${ABC_UTILS_DIR}/bin"
UTILS_TARGET_PATH     := "${APPLI_TARGET_PATH}"

do_install() {
   install -d ${D}${APPLI_TARGET_PATH}
   install -m 0550 ${APPLI_BIN_PATH}/${APPLI_NAME} ${D}${APPLI_TARGET_PATH}

   install -d ${D}${libdir}
   install -m 0644 ${APPLI_BIN_PATH}/abc.a ${D}/${libdir}

   install -d ${D}${includedir}
   install -m 0644 ${APPLI_PATH}/inc/abc.h ${D}/${includedir}
}

FILES_${PN} = "\
${APPLI_TARGET_PATH} \
"

0 个答案:

没有答案