安装arm-linux-gcc-4.3.2

1. 下载arm-linux-gcc-4.3.2,地址是 http://www.friendlyarm.net/dl.php?file=arm-linux-gcc-4.3.2.tgz 。
2. 以root用户登入

3. 解压命令tar xvzf arm-linux-gcc-4.3.2 -C /

4. 配置下编译环境路径

    在文件/root/.bashrc 和~/.bashrc中最后添加下面内容:

    export PATH=/usr/local/arm/4.3.2/bin:$PATH

5. 输入arm-linux-gcc -v 验证是否安装成功

 

至此安装成功!如果是动态链接的程序,板子上需要拷贝相关的库文件到/lib目录下,具体的文件如下:

/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libc.so.6
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libc-2.8.so
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ld-linux.so.3
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libgcc_s.so.1
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libm.so.6
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libdl.so.2
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/librt.so.1
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libpthread.so.0
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libpthread-2.8.so
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libstdc++.so.6
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libstdc++.so.6.0.10
前四个文件是必须的,其他的是可选的

复制时可以执行下面脚本:

cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libc* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/ld-linux* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libgcc_s* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libm* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libdl* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/librt* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/lib/libpthread* ~/opt/lib
cp /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib/libstdc++* ~/opt/lib

最后要添加开发板的LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib

你可能感兴趣的:(脚本,Path,library)