6.安装gcc:
由于gcc的安装依赖gmp和mpfr,gmp又依赖m4,因此首先安装m4、gmp和mpfr:
安装m4:
apt-get install m4
安装gmp:
cd ../
mkdir build-gmp
cd build-gmp
../gmp-4.2/configure --prefix=/usr/local/gmp(该部分为安装目录)
make
make check
make install
安装mpfr:
cd ../
mkdir build-mpfr
cd build-mpfr
../mpfr-2.4.2/configure --prefix=/usr/local/mpfr --with-gmp=/usr/local/gmp(指定gmp的安装位置)
make
make check
make install
安装gcc:
cd ../
cd gcc-core-4.4.7/
ln -s ../newlib-1.18.0/newlib
cd ../
mkdir build-gcc
cd build-gcc
在/root/.profile中加入以下内容:
export LD_LIBRARY_PATH=/usr/local/mpfr/lib:/usr/local/gmp/lib:${LD_LIBRARY_PATH}
然后使修改生效:source /root/.profile
../gcc-4.4.7/configure --target=i386-rtems4.10 --with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads --enable-languages="c,c++" --prefix=/opt/rtems-4.10 --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr
make all(编译时间比较长,请耐心等待)
make info
make install
7编译rtems源码包:
从官网下载rtems-4.10源码包;
然后:
tar jxvf rtems-4.10.2.tar.bz2
mkdir build-rtems
cd build-rtems
../rtems-4.10.2/configure --target=i386-rtems4.10 --enable-posix --enable-networking --enable-cxx --enable-rtemsbsp=pc386 --prefix=/opt/rtems-4.10/
make all install
如果编译rtems没有出现错误,则说明工具链安装成功!
