Yocto - 使用Yocto开发嵌入式Linux系统_10 使用Yocto项目进行开发

Developing with the Yocto Project
在本书中,我们一直将 Poky 用作构建工具。换句话说,我们将其用作设计和生成镜像的工具,将镜像交付到产品。
So far in this book, we have used Poky as a build tool. In other words, we have used it as a tool to design and generate the image delivered to products.
在本章中,我们将了解如何在目标机内部设置开发环境,以及如何使用标准 SDK 和可扩展 SDK 工具,这些工具可以帮助我们在目标机之外开发应用程序。例如,它们允许我们交叉编译应用程序、配方和图像。
In this chapter, we will see how to set up a development environment for use inside the target and meet the Standard SDK and Extensible SDK tools, which can help us develop applications outside the target. For example, they allow us to cross-compile applications, recipes, and images.
1, What is a software development kit?
在嵌入式开发中,工具链通常由跨平台工具或在一种体系结构上执行的工具组成,然后生成二进制文件供另一种体系结构使用--例如,在 x86-64 兼容机器上运行的 GCC 工具为 ARM 机器生成的二进制文件就是一个交叉编译器。当工具和生成的二进制文件依赖于运行工具的同一主机时,通常称为本地构建。构建和目标架构可能相同,但如果目标二进制文件使用单独保存的根文件系统查找其依赖项,则属于交叉编译。
In embedded development, the toolchain is often composed of cross-platform tools or tools executed on one architecture, which then produces a binary for use in another architecture – for example, a GCC tool that runs on an x86-64-compatible machine and generates binaries for an ARM machine is a cross-compiler. When a tool and the resulting binaries rely on dependencies from the same host on which the tool runs, this is commonly called a native build. Build and target architectures may be the same, but it is cross-compilation if the target binary uses a staged root filesystem to find its dependencies.
软件开发工具包(SDK)是一套用于开发和调试程序的工具和文件。这些工具包括编译器、链接器、调试器、外部库、头文件和二进制文件,也称为工具链。它还可能包括额外的实用程序和应用程序。我们可以使用两种 SDK:
A software development kit (SDK) is a set of tools and files to develop and debug applications. These tools include compilers, linkers, debuggers, external libraries, headers, and binaries, also called a toolchain. It may also include extra utilities and applications. We can have two types of SDK:
* 交叉开发SDK: 其目标是在开发主机中使用,为目标生成二进制文件。
* 本地SDK: 目标是在目标设备上运行
* Cross-development SDKs: These have the goal of being used in the development host to generate binaries for the target
* Native SDKs: These aim to run on the target device
2,  Generating a native SDK for on-device development
有些嵌入式设备功能强大,足以用作开发环境。但是,不同的库或应用程序构建所需的资源差别很大,因此使用目标设备作为构建环境并不总是可行的。开发映像需要以下资源:
Some embedded devices are powerful enough to be used as a development environment. However, the resources needed for the build vary significantly from one library or application to another, so using the target as the building environment may not always be viable. The development image needs the following:
* The header files and libraries
* The toolchain
下面一行将这些属性添加到图像中:
The following line adds these properties to an image:
[ Figure 9.1 – How to configure an image to include development artifacts  ]
上例中的 IMAGE_FEATURES 对镜像功能进行了如下扩展:
IMAGE_FEATURES in the preceding example extends the image functionality as follows:
* dev-pkgs: 为指定镜像中安装的所有软件包安装开发包(头文件和额外的库链接)
* tools-sdk: 安装在设备上运行的工具链
* dev-pkgs: Installs development packages (headers and extra library links) for all packages installed in a given image
* tools-sdk: Installs the toolchain that runs on the device
有关 IMAGE_FEATURES 变量的详细介绍,请参阅第 12 章 创建自定义图层。
The IMAGE_FEATURES variable is described in more detail in Chapter 12, Creating Custom Layers.
Tip
如果我们只想修改 build/conf/local.conf,则应使用 EXTRA_IMAGE_FEATURES 变量。
If we want to modify only build/conf/local.conf, the variable we should use is EXTRA_IMAGE_FEATURES.
目标机器可以在应用程序开发周期中使用该镜像,并在为同一项目工作的所有开发人员之间共享该镜像。每个开发人员都将拥有一份副本,开发团队将始终使用相同的开发环境。
The target can use this image during the application development cycle and share the image among all developers working on the same project. Each developer will have a copy, and the development team will use the same development environment consistently.
3, Understanding the types of cross-developm
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值