我习惯于这样做uname -m
(Windows 粉丝可以使用 的输出SET processor
),所以对 Yocto 的我来说,这最终是一个折腾:
- 根据TARGET_ARCH的 Mega-Manual 条目:
TARGET_ARCH
The target machine's architecture. The OpenEmbedded build system supports many
architectures. Here is an example list of architectures supported. This list is by
no means complete as the architecture is configurable:
arm
i586
x86_64
powerpc
powerpc64
mips
mipsel
uname -m
好一点,因为您也获得了子架构信息。从我现在可以访问的机器上:
Intel-based Nuc build system: x86_64
ARM embedded system: armv7l
Raspberry Pi 4B: aarch64
我发现 GNU automake
(native) 和libtool
(available for target) 包计算了一个名为 UNAME_MACHINE_ARCH 的有用变量。如果您已经使用libtool
或愿意接受它只是为了为您完成此操作:-@),您可以通过这种方式解决。在构建的树中查找名为config.guess
.
您可能比libtool
使用 Yocto BUILD_ARCH更通用:
BUILD_ARCH
Specifies the architecture of the build host (e.g. i686). The OpenEmbedded build
system sets the value of BUILD_ARCH from the machine name reported by the uname
command.
因此,请根据您的项目情况使用这些并做出自己的选择。