Chinaunix首页 | 论坛 | 博客
  • 博客访问: 649680
  • 博文数量: 90
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 2018
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-03 13:09
文章分类

全部博文(90)

文章存档

2010年(7)

2009年(23)

2008年(60)

我的朋友

分类: LINUX

2008-10-11 19:24:24

本文主要解释下 Architecture-dependent build variables变量可以在 conf/bitbake.conf找到


BUILD_ARCH = "${@os.uname()[4]}"
BUILD_OS = "${@os.uname()[0].lower()}"
BUILD_VENDOR = ""
BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
BUILD_PREFIX = ""
BUILD_CC_ARCH = ""


比如在我当前的机器上,以上变量也就是(可以通过python执行上述语句得到)

BUILD_ARCH = "i686"
BUILD_OS = "linux"
BUILD_VENDOR = ""
BUILD_SYS = "i686-linux"
BUILD_PREFIX = ""
BUILD_CC_ARCH = ""





HOST_ARCH = "${TARGET_ARCH}"
HOST_OS = "${TARGET_OS}"
HOST_VENDOR = "${TARGET_VENDOR}"
HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
HOST_PREFIX = "${TARGET_PREFIX}"
HOST_CC_ARCH = "${TARGET_CC_ARCH}"


HOST也就是你build 的os类型,比如我选择了MACHINE x86.conf,我们在x86.conf可以发现

TARGET_ARCH = "i486"

TARGET_OS default is linux,一般在 distro 中设置,不过我怎么没有找到TARGET_OS default 在哪里定义 ^_^

host_arch  is arm
host_os  is linux-gnueabi
host_vendor  is -angstrom
host_sys  is arm-angstrom-linux-gnueabi



TARGET_ARCH ?= "INVALID"
TARGET_OS = "INVALID"
TARGET_VENDOR = "${BUILD_VENDOR}"
TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}"
TARGET_PREFIX = "${TARGET_SYS}-"
TARGET_CC_ARCH = ""


TARGET_SYS 是通过一个 ${@ 来获得,就是说 如果TARGET_OS的值为空或者等于custom,那么就返回空,否则就返回  '-' + bb.data.getVar('TARGET_OS', d, 1)
target_arch  is arm
target_os  is linux-gnueabi
target_vendor is -angstrom
target_sys  is arm-angstrom-linux-gnueabi


阅读(841) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~