3.3.2.1. crosstool-ng本身相关的重要参数

此处介绍,和crosstool-ng,为了交叉编译,作为工具本身方面的一些常见的,重要的参数的配置。

3.3.2.1.1. 源码包下载保存路径

常见配置如下:


Paths and misc options
    (${HOME}/develop/crosstool-ng/src) Local tarballs directory

                

Local tarballs directory的help的说明为:


  ┌───────────────────────── Local tarballs directory ──────────────────────────┐
  │ CT_LOCAL_TARBALLS_DIR:                                                      │
  │                                                                             │
  │ If you have previously downloaded the tarballs, enter the PATH where        │
  │ you stored them here.                                                       │
  │                                                                             │
  │ Symbol: LOCAL_TARBALLS_DIR [=${HOME}/develop/crosstool-ng/src]              │
  │ Type  : string                                                              │
  │ Prompt: Local tarballs directory                                            │
  │   Defined at config/global/paths.in:5                                       │
  │   Depends on: !BACKEND [=n]                                                 │
  │   Location:                                                                 │
  │     -> Paths and misc options                                               │

                

即,你之前配置好的各种模块,包括C库,GCC,binutils等等所有的东西,下载下来,都放在此文件夹中。

对应的路径配置,可以参考前面介绍的:3

3.3.2.1.2. 工作路径

所有的东西,都放在其下,包括:

  • 编译时所生成的arm-xscale-linux-gnueabi文件夹
  • 所有模块解压的源码在其下的src路径下

一般使用默认配置,如下:


Paths and misc options
    (${CT_TOP_DIR}/.build) Working directory

                

Working directory的help的说明为:


  ┌───────────────────────────── Working directory ─────────────────────────────┐
  │ CT_WORK_DIR:                                                                │
  │                                                                             │
  │ Set this to the directory where all build actions will be done.             │
  │                                                                             │
  │ The default is "${CT_TOP_DIR}/.build", and leaving this option              │
  │ empty will also use the default.                                            │
  │                                                                             │
  │ You should not need to change that, except in one very peculiar             │
  │ setup:                                                                      │
  │  - your crosstool-NG source directory is on the network                     │
  │  - you configured crosstool-NG with --local                                 │
  │ This kind of setup is a pain, as any action involving source file           │
  │ access would have to go through the wire. In this case, you should          │
  │ set CT_WORK_DIR to point to a path local to your machine, to avoid          │
  │ any network overhead.                                                       │
  │                                                                             │
  │ Do *NOT* change it if you don't know better.                                │
  │                                                                             │
  │ Symbol: WORK_DIR [=${CT_TOP_DIR}/.build]                                    │
  │ Type  : string                                                              │
  │ Prompt: Working directory                                                   │
  │   Defined at config/global/paths.in:31                                      │
  │   Depends on: !BACKEND [=n]                                                 │
  │   Location:                                                                 │
  │     -> Paths and misc options                                               │

                
3.3.2.1.3. 目标安装路径

改为你自己的,对应的x-tools/${CT_TARGET}的路径:


Paths and misc options
    (${HOME}/develop/crosstool-ng/x-tools/${CT_TARGET}) Prefix directory

                

Prefix directory的help的说明为:


  ┌────────────────────────────── Prefix directory ──────────────────────────────┐
  │ CT_PREFIX_DIR:                                                               │
  │                                                                              │
  │ This is the path the toolchain will run from.                                │
  │                                                                              │
  │ Symbol: PREFIX_DIR [=${HOME}/develop/crosstool-ng/x-tools/${CT_TARGET}]      │
  │ Type  : string                                                               │
  │ Prompt: Prefix directory                                                     │
  │   Defined at config/global/paths.in:52                                       │
  │   Depends on: !BACKEND [=n]                                                  │
  │   Location:                                                                  │
  │     -> Paths and misc options                                                │

                

此处对应的x-tools路径,可参考之前的解释:4