自己想制作个交叉编译器;
按网上的资料到
http://ftp.gnu.org上下了
crosstool-0.43.tar.gz
gcc-4.5.2.tar.gz
glibc-2.3.6.tar.gz
glibc-linuxthreads-2.3.6.tar.gz
linux-libc-headers-2.6.12.0.tar.gz
linux-2.6.34.1.tar.bz2
............
等资源文件
解压crosstool.
修改了arm.dat如下:
KERNELCONFIG=`pwd`/arm.config
TARGET=arm-linux
TARGET_CFLAGS="-O"
修改gcc-4.0.2-glibc-2.3.6.dat如下
BINUTILS_DIR=binutils-2.21
GCC_DIR=gcc-4.5.2
GLIBC_DIR=glibc-2.3.6
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.6
LINUX_DIR=linux-2.6.34.1
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
然后新建arm.sh如下:
#!/bin/sh
set -ex
TARBALLS_DIR=/home/qin/crosstool/downloads #资源文件放置的路径
RESULT_TOP=/opt/crosstool #define the tool install dir
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++" #define the support languess
export GCC_LANGUESS
#mkdir -p $RESULT_TOP #Create /opt/crosstool dir ,had mk
mkdir -p $RESULT_TOP
eval 'cat arm.dat gcc-4.0.2-glibc-2.3.6.dat' sh all.sh --notest
echo Done
最后执行./arm.sh的log为:
root@ubuntu:/home/qin/crosstool# ./arm.sh
+ TARBALLS_DIR=/home/qin/crosstool/downloads
+ RESULT_TOP=/opt/crosstool
+ export TARBALLS_DIR RESULT_TOP
+ GCC_LANGUAGES=c,c++
+ export GCC_LANGUESS
+ mkdir -p /opt/crosstool
+ eval cat arm.dat gcc-4.0.2-glibc-2.3.6.dat sh all.sh --notest
+ cat arm.dat gcc-4.0.2-glibc-2.3.6.dat sh all.sh --notest
cat: unrecognized option '--notest'
Try `cat --help' for more information.
--------------------------------------------------------
这个--notest是做神马用的呢?
如果去掉这个--notest
输出又变成了
cat: sh: No such file or directory
------------------------------------------
不解中......
求高人指点,小弟不胜感激!
先行谢过!
[ 此帖被qinqin04在2011-03-16 00:26重新编辑 ]