Windows-7 Ubuntu-14.04.5 64位开发环境指导

来自乐兔兔Wiki
跳到导航 跳到搜索

安装虚拟机

到网盘下载vmware 10和Ubuntu 14.04镜像文件,安装步骤参考《vmware虚拟机安装使用教程》
  • 网盘请联系管理员。

开发环境搭建

安装基本的软件包
$ sudo apt-get install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev git-core curl lib32ncurses5 lib32z1 lib32bz2-1.0 lib32stdc++6 u-boot-tools bison flex gperf
备份更新源文件
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改更新源文件(修改为阿里云的源)
$ sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
更新源列表:
$ sudo apt-get update

安装交叉编译工具链

到网盘下载gcc-4.6.2-fsl-linaro-toolchain.tar.gz文件拷贝并解压到你的工作目录下,然后解压
$cd ~
$mkdir work
$mv gcc-4.6.2-fsl-linaro-toolchain.tar.gz  work
$cd work
$tar zxvf gcc-4.6.2-fsl-linaro-toolchain.tar.gz -C /opt/
配置全局的环境变量,修改/etc/bash.bashrc文件,命令如下:
$ sudo vim /etc/bash.bashrc
在文件末尾加入如下几行:
export  ARCH=arm
export  CROSS_COMPILE=/opt/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-
export  PATH=/opt/fsl-linaro-toolchain/bin:$PATH
如下图:

Imx6-cross.jpg

使环境变量生效,查看当前交叉编译器版本
$ source /etc/bash.bashrc
$ arm-linux-gcc –v
输出如下图:

Imx6-gcc.jpg