這篇文章主要介紹"如何製作一個"cross-compiling development environment for the Raspberry Pi"。
以下介紹兩個製作PI的 cross-compiling development environment
#sudo apt-get install git
2. 如果你的Ubuntu是安裝X64的,則需要安裝32-bits的library
#sudo apt-get install ia32-libs
3.下載官方版本的Cross Compile
#sudo git clone git://github.com/raspberrypi/tools.git
可取得三個cross-compile的版本
- arm-bcm2708-linux-gnueabi
- arm-bcm2708hardfp-linux-gnueai (針對硬體浮點數運算)
- gcc-linaro-arm-linux-gnueabihf-raspbian (針對raspbian OS)
2.安裝crosstool-ng會用到的套件
#sudo aptitude install bison cvs flex gperf texinfo automake libtool subversion gcj-jdk
3.解壓縮
#tar -jxvf crosstool-ng-1.18.0.tar.bz2 ; cd crosstool-ng-1.18.0
4.configuration
#./configure --prefix=$(PWD)/install
5. compiler
#make ; make install
6. menuconfig
#cd install/bin ; ./ct-ng menuconfig
- [Paths and mis options] ->
- <*>Try features marked as EXPERIMENTAL
- (${HOME}/x-tools/${CT_TARGET})) Prefix directory
- [Target options] ->
- Target Architecture (arm)
- Endianness: (Little endian)
- [Operation System] ->
- Target OS (linux)
- Endianness: (Little endian)
- [binutils version (2.22)] ->
- [C compiler] ->
- gcc version (4.7.2)
- <*> C++
- [C libray] ->
- C library (eglibc)
- eglibc version (2_17)
#./ct-ng build
8. 完成以上步驟後,可從 (${HOME}/x-tools/${CT_TARGET}))取得cross complie ,一樣可以透過-v得知版本
沒有留言:
張貼留言