标签:
一、环境准备
使用Debian平台,需做如下环境检查:
1、检查各个需要的工具及内核版本号,看看是否符合lfs7.7的列表要求
2、检查需要用到的库,一共有三个,gmp, mpfr和mpc
工具检查脚本如下:
#/bin/sh export LC_ALL=C # check for bash bash --version | head -n1 | cut -d" " -f2-4 echo "/bin/sh -> `readlink -f /bin/sh`" echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- bison --version | head -n1 # check for yacc if [ -h /usr/bin/yacc ]; then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; elif [ -x /usr/bin/yacc ]; then echo yacc is `/usr/bin/yacc --version | head -n1` else echo "yacc not found" fi # check for other bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 diff --version | head -n1 find --version | head -n1 gawk --version | head -n1 if [ -h /usr/bin/awk ]; then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; elif [ -x /usr/bin/awk ]; then echo yacc is `/usr/bin/awk --version | head -n1` else echo "awk not found" fi gcc --version | head -n1 g++ --version | head -n1 ldd --version | head -n1 | cut -d" " -f2- # glibc version grep --version | head -n1 gzip --version | head -n1 cat /proc/version m4 --version | head -n1 make --version | head -n1 patch --version | head -n1 echo Perl `perl -V:version` sed --version | head -n1 tar --version | head -n1 makeinfo --version | head -n1 xz --version | head -n1 echo "main(){}" > dummy.c && g++ -o dummy dummy.c if [ -x dummy ]; then echo "g++ compilation OK"; else echo "g++ compilation failed"; fi rm -f dummy.c dummy
若结果如下,则环境就绪
若出现“command not found”,则缺少工具,可执行如下命令进行安装(以安装gawk工具为例)
sudo aptitude install gawk
库检查脚本如下:
#filename:check_lib.sh
#!/bin/bash for lib in lib{gmp,mpfr,mpc}.la; do echo $lib: $( if find /usr/lib* -name $lib | grep -q $lib; then :; else echo not; fi ) found done unset lib
结果显示,三个库目前都不具备
标签:
原文地址:http://www.cnblogs.com/274914765qq/p/4413784.html