wutiejun / workspace

My workspace.
7 stars 3 forks source link

crosstool-ng #6

Open wutiejun opened 8 years ago

wutiejun commented 8 years ago

crosstool-ng

home: http://crosstool-ng.org/ download: http://crosstool-ng.org/download/crosstool-ng/

  1. download:
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2
  1. config & build:
tar xjf crosstool-ng-VERSION.tar.bz2
cd crosstool-ng-VERSION
./configure --prefix=/some/place
make
make install
export PATH="${PATH}:/some/place/bin"
  1. use it
mkdir /a/directory/to/build/your/toolchain
cd /a/directory/to/build/your/toolchain
ct-ng help
ct-ng list-samples
ct-ng show-arm-unknown-linux-gnueabi
  1. build cross-tools for ram-unknow-linux-uclibceabi
ct-ng arm-unknown-linux-gnueabi
ct-ng menuconfig
ct-ng build
wutiejun commented 8 years ago

环境变量脚本

#!/bin/bash

script_name=$BASH_SOURCE
sdk_dir=`dirname $script_name`

script_name=$BASH_SOURCE
pushd `dirname $script_name` > /dev/null
sdk_dir=`pwd`
popd > /dev/null

# 编译工具链版本信息
export HW_CT_VER=gcc-4.4.6-uclibc-0.9.32

# 编译工具链根目录
export HW_CT_HOME=${sdk_dir}

# 编译工具链名
export HW_CT_TOOLS=arm-wap-linux-uclibcgnueabi

# 编译工具目标信息
export HW_CT_TARGET=arm-wap-linux-uclibcgnueabi

# 编译工具链别名
export HW_CT_TOOLS_ALIAS=wap

# 编译工具链内核SDK目录
export HW_CT_KERNEL=${sdk_dir}/${HW_CT_TARGET}/module

# 编译工具链用户程序SDK目录
export HW_CT_SDK=${sdk_dir}/${HW_CT_TARGET}/sysroot

# 编译工具链CPU架构信息
export HW_CT_ARCH=arm5115

if [ -z ${HW_CT_HOME} ] || [ -z `env | grep "^PATH" | grep ${HW_CT_HOME}/bin` ] ; then
        PATH=$PATH:${HW_CT_HOME}/bin:${HW_CT_HOME}/bin/sbin
        echo "Set HW_CT_TOOLS SDK path and enviroment successfully."
else
        echo "HW_CT_TOOLS SDK path and enviroment already set."
fi