Ubuntu16.04无法安装libtool,只能在Ubuntu14.04以下版本安装。

cp 下载/crosstool-ng-1.22.0.tar.bz2 /home/hou/

tar -xvf crosstool-ng-1.22.0.tar.bz2

cd crosstool-ng

 
 

安装一些必要的软件:

apt install gperf bison flex texinfo help2man gawk libtool libncurses5-dev

Make

./configure --prefix=/home/hou/arm/crosstool-ng-1.22.0_install

 
 

屏幕剪辑的捕获时间: 2016/5/22 11:18

sudo make install

 
 

 
 

屏幕剪辑的捕获时间: 2016/5/22 11:20

在~/.bashrc 配置ct-ng命令的环境变量

目录:

love-xin :: ~/arm/crosstool-ng-1.22.0_build % ct-ng list-steps

Available build steps, in order:

- libc_check_config

- companion_libs_for_build

- binutils_for_build

- companion_libs_for_host

- binutils_for_host

- cc_core_pass_1

- kernel_headers

- libc_start_files

- cc_core_pass_2

- libc

- cc_for_build

- cc_for_host

- libc_post_cc

- companion_libs_for_target

- binutils_for_target

- debug

- test_suite

- finish

Use "<step>" as action to execute only that step.

Use "+<step>" as action to execute up to that step.

Use "<step>+" as action to execute from that step onward.

love-xin :: ~/arm/crosstool-ng-1.22.0_build % ct-ng list-samples

Status Sample name

LN config

MKDIR config.gen

IN config.gen/arch.in

IN config.gen/kernel.in

IN config.gen/cc.in

IN config.gen/binutils.in

IN config.gen/libc.in

IN config.gen/debug.in

[G..] alphaev56-unknown-linux-gnu

[G..] alphaev67-unknown-linux-gnu

[G..] arm-bare_newlib_cortex_m3_nommu-eabi

[G..] arm-cortex_a15-linux-gnueabi

[G.X] arm-cortexa5-linux-uclibcgnueabihf

[G..] arm-cortex_a8-linux-gnueabi

[G.X] arm-cortexa9_neon-linux-gnueabihf

[G..] armeb-unknown-eabi

[G..] armeb-unknown-linux-gnueabi

[G..] armeb-unknown-linux-uclibcgnueabi

[G..] arm-unknown-eabi

[G..] arm-unknown-linux-gnueabi

[G.X] arm-unknown-linux-musleabi

[G..] arm-unknown-linux-uclibcgnueabi

[G.X] arm-unknown-linux-uclibcgnueabihf

[G..] armv6-rpi-linux-gnueabi

[G..] armv7-rpi2-linux-gnueabihf

[G..] avr

[G..] i586-geode-linux-uclibc

[G..] i586-mingw32msvc,i686-none-linux-gnu

[G..] i686-nptl-linux-gnu

[G.X] i686-w64-mingw32

[G..] m68k-unknown-elf

[G..] m68k-unknown-uclinux-uclibc

[G..] mips64el-n32-linux-uclibc

[G..] mips64el-n64-linux-uclibc

[G..] mips-ar2315-linux-gnu

[G..] mipsel-sde-elf

[G..] mipsel-unknown-linux-gnu

[G..] mips-malta-linux-gnu

[G..] mips-unknown-elf

[G..] mips-unknown-linux-uclibc

[G.X] i686-w64-mingw32,nios2-spico-elf

[G..] powerpc-405-linux-gnu

[G..] powerpc64-unknown-linux-gnu

[G..] powerpc-860-linux-gnu

[G..] powerpc-e300c3-linux-gnu

[G..] powerpc-e500v2-linux-gnuspe

[G..] powerpc-unknown-linux-gnu

[G..] powerpc-unknown-linux-uclibc

[G..] powerpc-unknown_nofpu-linux-gnu

[G.X] s390-ibm-linux-gnu

[G..] s390x-ibm-linux-gnu

[G..] sh4-unknown-linux-gnu

[G..] sparc-unknown-linux-gnu

[G.X] x86_64-w64-mingw32,x86_64-pc-linux-gnu

[G..] x86_64-unknown-linux-gnu

[G..] x86_64-unknown-linux-uclibc

[G.X] x86_64-w64-mingw32

[G..] xtensa-unknown-linux-uclibc

L (Local) : sample was found in current directory

G (Global) : sample was installed with crosstool-NG

X (EXPERIMENTAL): sample may use EXPERIMENTAL features

B (BROKEN) : sample is currently broken

love-xin :: ~/arm/crosstool-ng-1.22.0_build %

在后续的配置(和编译)之后,可以通过show-tuple,去查看到当前配置的交叉编译器是啥样的

love-xin :: ~/arm/crosstool-ng-1.22.0_build % ct-ng show-tuple

arm-cortexa9_neon-linux-gnueabihf

查看当前有哪些(默认的)示例配置,可以用:

ct-ng list-samples

查看单个的某个示例配置的核心参数,用:

ct-ng show-<sample>

love-xin :: ~/arm/crosstool-ng-1.22.0_build % ct-ng show-arm-cortexa9_neon-linux-gnueabihf

IN config.gen/arch.in

IN config.gen/kernel.in

IN config.gen/cc.in

IN config.gen/binutils.in

IN config.gen/libc.in

[G.X] arm-cortexa9_neon-linux-gnueabihf

OS : linux-4.3

Companion libs : gmp-6.0.0a mpfr-3.1.3 mpc-1.0.3 expat-2.1.0 ncurses-6.0

binutils : binutils-2.22

C compilers : gcc | 5.2.0

Languages : C,C++

C library : glibc-2.22 (threads: nptl)

Tools : gdb-7.10

love-xin :: ~/arm/crosstool-ng-1.22.0_build %

 
 

 
 

 
 

屏幕剪辑的捕获时间: 2016/5/22 12:34

 
 

iTop4412是使用cortex-a9,所以按照这个配置就OK,上面是软件要求。

可以直接去调用此配置了:

ct-ng arm-cortexa9-linux-gnueabi

 
 

 
 

屏幕剪辑的捕获时间: 2016/5/22 13:08

接下来,你就可以去进入配置:

ct-ng menuconfig

 
 

源码包下载保存路径

Paths and misc options
(${HOME}/arm/src) Local tarballs directory

工作路径

一般使用默认配置

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

目标安装路径

 
 

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

一些详细的配置请参考网站:

crosstool-ng详解

 
 

src下面主要用到linux、gcc两个安装包,这两个包比较大,可以提前下载好。其它的包自动下载。

 
 

配置好后,保存退出。执行ct-ng build编译

 
 

 
 

屏幕剪辑的捕获时间: 2016/5/22 15:06

编译详细过程:

╭─hou@love-xin ~/arm/crosstool-ng-1.22.0_build

╰─$ ct-ng build

[INFO ] Performing some trivial sanity checks

[INFO ] Build started 20160522.191913

[INFO ] Building environment variables

[EXTRA] Preparing working directories

[EXTRA] Installing user-supplied crosstool-NG configuration

[EXTRA] =================================================================

[EXTRA] Dumping internal crosstool-NG configuration

[EXTRA] Building a toolchain for:

[EXTRA] build = x86_64-pc-linux-gnu

[EXTRA] host = x86_64-pc-linux-gnu

[EXTRA] target = arm-cortexa9_neon-linux-gnueabihf

[EXTRA] Dumping internal crosstool-NG configuration: done in 0.10s (at 00:08)

[INFO ] =================================================================

[INFO ] Retrieving needed toolchain components' tarballs

[EXTRA] Retrieving 'glibc-libidn-2.22'

[INFO ] Retrieving needed toolchain components' tarballs: done in 362.72s (at 06:11)

[INFO ] =================================================================

[INFO ] Extracting and patching toolchain components

[INFO ] Extracting and patching toolchain components: done in 2.59s (at 06:13)

[INFO ] Saving state to restart at step 'libc_check_config'...

[INFO ] Saving state to restart at step 'companion_libs_for_build'...

[INFO ] =================================================================

[INFO ] Installing ncurses for build

[EXTRA] Configuring ncurses

[EXTRA] Building ncurses

[EXTRA] Installing ncurses

[INFO ] Installing ncurses for build: done in 39.95s (at 06:53)

[INFO ] Saving state to restart at step 'binutils_for_build'...

[INFO ] Saving state to restart at step 'companion_libs_for_host'...

[INFO ] =================================================================

[INFO ] Installing GMP for host

[EXTRA] Configuring GMP

[EXTRA] Building GMP

[EXTRA] Installing GMP

[INFO ] Installing GMP for host: done in 47.59s (at 07:42)

[INFO ] =================================================================

[INFO ] Installing MPFR for host

[EXTRA] Configuring MPFR

[EXTRA] Building MPFR

[EXTRA] Installing MPFR

[INFO ] Installing MPFR for host: done in 36.57s (at 08:19)

[INFO ] =================================================================

[INFO ] Installing ISL for host

[EXTRA] Configuring ISL

[EXTRA] Building ISL

[EXTRA] Installing ISL

[INFO ] Installing ISL for host: done in 33.91s (at 08:53)

[INFO ] =================================================================

[INFO ] Installing MPC for host

[EXTRA] Configuring MPC

[EXTRA] Building MPC

[EXTRA] Installing MPC

[INFO ] Installing MPC for host: done in 16.35s (at 09:09)

[INFO ] =================================================================

[INFO ] Installing expat for host

[EXTRA] Configuring expat

[EXTRA] Building expat

[EXTRA] Installing expat

[INFO ] Installing expat for host: done in 7.11s (at 09:16)

[INFO ] Saving state to restart at step 'binutils_for_host'...

[INFO ] =================================================================

[INFO ] Installing binutils for host

[EXTRA] Configuring binutils

[EXTRA] Building binutils

[EXTRA] Installing binutils

[EXTRA] Installing ld wrapper

[INFO ] Installing binutils for host: done in 199.40s (at 12:37)

[INFO ] Saving state to restart at step 'cc_core_pass_1'...

[INFO ] =================================================================

[INFO ] Installing pass-1 core C gcc compiler

[EXTRA] Configuring core C gcc compiler

[EXTRA] Building gcc

[EXTRA] Installing gcc

[EXTRA] Housekeeping for final gcc compiler

[INFO ] Installing pass-1 core C gcc compiler: done in 538.26s (at 21:46)

[INFO ] Saving state to restart at step 'kernel_headers'...

[INFO ] =================================================================

[INFO ] Installing kernel headers

[EXTRA] Installing kernel headers

[EXTRA] Checking installed headers

[INFO ] Installing kernel headers: done in 11.64s (at 22:16)

[INFO ] Saving state to restart at step 'libc_start_files'...

[INFO ] =================================================================

[INFO ] Installing C library headers & start files

[EXTRA] Configuring C library

[EXTRA] Installing C library headers

[EXTRA] Installing C library start files

[INFO ] Installing C library headers & start files: done in 23.37s (at 22:54)

[INFO ] Saving state to restart at step 'cc_core_pass_2'...

[INFO ] =================================================================

[INFO ] Installing pass-2 core C gcc compiler

[EXTRA] Configuring core C gcc compiler

[EXTRA] Building gcc

[EXTRA] Installing gcc

[EXTRA] Housekeeping for final gcc compiler

[INFO ] Installing pass-2 core C gcc compiler: done in 657.92s (at 34:06)

[INFO ] Saving state to restart at step 'libc'...

[INFO ] =================================================================

[INFO ] Installing C library

[EXTRA] Configuring C library

[EXTRA] Building C library

[EXTRA] Installing C library

[EXTRA] Configuring C library localedef

[EXTRA] Building C library localedef

[EXTRA] Installing C library locales

[INFO ] Installing C library: done in 861.70s (at 48:47)

[INFO ] Saving state to restart at step 'cc_for_build'...

[INFO ] Saving state to restart at step 'cc_for_host'...

[INFO ] =================================================================

[INFO ] Installing final gcc compiler

[EXTRA] Configuring final gcc compiler

[EXTRA] Building final gcc compiler

[EXTRA] Installing final gcc compiler

[EXTRA] Housekeeping for final gcc compiler

[INFO ] Installing final gcc compiler: done in 902.17s (at 64:39)

[INFO ] Saving state to restart at step 'libc_post_cc'...

[INFO ] Saving state to restart at step 'companion_libs_for_target'...

[INFO ] =================================================================

[INFO ] Installing expat for target

[EXTRA] Configuring expat

[EXTRA] Building expat

[EXTRA] Installing expat

[INFO ] Installing expat for target: done in 6.22s (at 66:33)

[INFO ] =================================================================

[INFO ] Installing ncurses for target

[EXTRA] Configuring ncurses

[EXTRA] Building ncurses

[EXTRA] Installing ncurses

[INFO ] Installing ncurses for target: done in 49.44s (at 67:22)

[INFO ] Saving state to restart at step 'binutils_for_target'...

[INFO ] Saving state to restart at step 'debug'...

[INFO ] =================================================================

[INFO ] Installing cross-gdb

[EXTRA] Configuring cross-gdb

[EXTRA] Building cross-gdb

[EXTRA] Installing cross-gdb

[EXTRA] Installing '.gdbinit' template

[INFO ] Installing cross-gdb: done in 197.27s (at 71:44)

[INFO ] =================================================================

[INFO ] Installing native gdb

[EXTRA] Configuring native gdb

[EXTRA] Building native gdb

[EXTRA] Installing native gdb

[INFO ] Installing native gdb: done in 184.36s (at 74:48)

[INFO ] =================================================================

[INFO ] Installing gdbserver

[EXTRA] Configuring gdbserver

[EXTRA] Building gdbserver

[EXTRA] Installing gdbserver

[INFO ] Installing gdbserver: done in 60.28s (at 75:49)

[INFO ] Saving state to restart at step 'test_suite'...

[INFO ] Saving state to restart at step 'finish'...

[INFO ] =================================================================

[INFO ] Cleaning-up the toolchain's directory

[INFO ] Stripping all toolchain executables

[EXTRA] Installing the populate helper

[EXTRA] Installing a cross-ldd helper

[EXTRA] Creating toolchain aliases

[EXTRA] Removing access to the build system tools

[EXTRA] Removing installed documentation

[INFO ] Cleaning-up the toolchain's directory: done in 3.83s (at 77:27)

[INFO ] Build completed at 20160522.203639

[INFO ] (elapsed: 77:26.35)

[INFO ] Finishing installation (may take a few seconds)...

[77:27] / % ╭─hou@love-xin ~/arm/crosstool-ng-1.22.0_build

╰─$

添加环境变量:

sudo vim ~/.bashrc

在PATH变量中添加:${HOME}/arm/x-tools/arm-cortexa9_neon-linux-gnueabihf/bin

刷新:

source ~/.bashrc

 
 

 
 

屏幕剪辑的捕获时间: 2016/5/22 21:01

 
 

love-xin :: ~/arm/crosstool-ng-1.22.0_build » arm-cortexa9_neon-linux-gnueabihf-gcc --version

arm-cortexa9_neon-linux-gnueabihf-gcc (crosstool-NG crosstool-ng-1.22.0) 5.2.0

Copyright © 2015 Free Software Foundation, Inc.

本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;

包括没有适销性和某一专用目的下的适用性担保。

love-xin :: ~/arm/crosstool-ng-1.22.0_build »

 
 

为了不影响主机看网页、玩游戏,当时设置Ubuntu是2G运行内存,所以时间有点慢,想要快点可以设置大一点。

 
 

 
 

 
 

 
 

 
 

 
 

 
 

 
 

 
 

 
 

crosstool-ng-1.22.0搭建开发环境的更多相关文章

  1. Eclipse搭建Android5.0应用开发环境 “ndk-build”:launchingfailed问题解决

    Eclipse搭建Android5.0应用开发环境 "ndk-build":launchingfailed问题解决 详细参考http://blog.csdn.net/loongem ...

  2. 3、Cocos2dx 3.0游戏开发找小三之搭建开发环境

    尊重开发人员的劳动成果.转载的时候请务必注明出处:http://blog.csdn.net/haomengzhu/article/details/27107295 搭建开发环境 使用 Cocos2d- ...

  3. vue_使用npm搭建vue2.0脚手架开发环境

    前言: 在使用vue进行开发时需要搭建vue的运行环境,这里主要是使用淘宝镜像cnpm进行搭建vue的脚手架开发环境.主要是分为mac和window两个版本,两个环境的搭建都是大同小异. mac开发环 ...

  4. vue.js2.0实战(1):搭建开发环境及构建项目

    Vue.js学习系列: vue.js2.0实战(1):搭建开发环境及构建项目 https://my.oschina.net/brillantzhao/blog/1541638 vue.js2.0实战( ...

  5. 从0开发3D引擎(三):搭建开发环境

    本系列使用Reason语言,因此需要搭建它的开发环境. 上一篇博文 从0开发3D引擎(二):准备预备知识 搭建开发环境 建议使用VSCode编辑器来开发Reason,因为它的插件支持得最好. 具体搭建 ...

  6. 第0课 - 搭建开发环境之安装QT

    第0课 - 搭建开发环境之安装Qt 1. 课程学习的原材料 — Visual Studio 2010 — Qt SDK 4.7.4 — Qt Creator 2.4.1 2. Visual Studi ...

  7. 从0系统学Android--1.2 手把手带你搭建开发环境

    要想进行程序开发,首先我们需要搭建开发环境,下面就开始搭建环境. 1.2.1 所需的工具 首先 Android 开发是基于 Java 的,因此你需要掌握简单的 Java 语法.会基础的 Java 语法 ...

  8. Android移动APP开发笔记——最新版Cordova 5.3.1(PhoneGap)搭建开发环境

    引言 简单介绍一下Cordova的来历,Cordova的前身叫PhoneGap,自被Adobe收购后交由Apache管理,并将其核心功能开源改名为Cordova.它能让你使用HTML5轻松调用本地AP ...

  9. 混合式app ionic2.x 手动搭建开发环境教程分享(nodejs,jdk,ant,androidsdk)

    1.ionic简介 为什么选用ionic: 彻底开源且免费 性能优异 基于红的发紫的AngularJs 漂亮的UI 强大的命令行(基于更热门的nodejs) 开发团队非常活跃 ngCordova,将主 ...

随机推荐

  1. Python内置函数(54)——reversed

    英文文档: reversed(seq) Return a reverse iterator. seq must be an object which has a __reversed__() meth ...

  2. shell的exec命令

    工作中遇到运维人员挂supervisor的时候建议启动使用命令control.sh start, 并且在control.sh 里面启动命令: exec -c ./bin/xxx -f config/x ...

  3. 并发编程(七)——AbstractQueuedSynchronizer 之 CountDownLatch、CyclicBarrier、Semaphore 源码分析

    这篇,我们的关注点是 AQS 最后的部分,共享模式的使用.本文先用 CountDownLatch 将共享模式说清楚,然后顺着把其他 AQS 相关的类 CyclicBarrier.Semaphore 的 ...

  4. 从零开始学习PYTHON3讲义(八)列表类型跟冒泡排序

    <从零开始PYTHON3>第八讲 ​前面我们见过了不少的小程序,也见过了不少不同类型的变量使用的方法.但目前我们涉及到的,还都是单个的变量和单个的立即数.以变量来说,目前我们见到的,基本都 ...

  5. .netcore使用SocketAsyncEventArgs Pool需要注意!

    在.net中做网络通讯往往都会用到SocketAsyncEventArgs,为了得到更好的性能配合Pool复用SocketAsyncEventArgs可以得到一个更好的效果,但在dotnet core ...

  6. 详解intellij idea搭建SSM框架(spring+maven+mybatis+mysql+junit)(下)

    在上一篇(详解intellij idea 搭建SSM框架(spring+maven+mybatis+mysql+junit)(上))博文中已经介绍了关于SSM框架的各种基础配置,(对于SSM配置不熟悉 ...

  7. EF架构~TransactionScope与SaveChanges的关系

    回到目录 TransactionScope是.net环境下的事务,可以提升为分布式事务,这些知识早在很久前就已经说过了,今天不再说它,今天主要谈谈Savechanges()这个方法在Transacti ...

  8. Chapter 5 Blood Type——17

    "I'll be coming around with a dropper of water to prepare your cards, so please don't start unt ...

  9. Java开发知识之Java控制语句

    Java开发知识之Java控制语句 一丶复合语句 不管任何语言都有控制语句 if else if else whie do  while  for .... 首先讲解的是java的复合语句 1.什么是 ...

  10. 装饰器模式 Decorator 结构型 设计模式 (十)

    引子           现实世界的装饰器模式 大家应该都吃过手抓饼,本文装饰器模式以手抓饼为模型展开简介 "老板,来一个手抓饼,  加个培根,  加个鸡蛋,多少钱?" 这句话会不 ...