My error with this page, even after having built one or two versions of
LFS, was that the last line:
"gcc compilation OK"
that made me ignore the other lines, when some of these lines were
telling me that I had requirements to fix.
I thought: "all right, host can compile, so the other lines are just
additional information or recommendations, may be".
i had the same problem. so i reworked the script.
i moved the compile test after checking for gcc, and put linux at the
end, as there have to be checked 2 versions
the output does not only show min requirement, but the current version
the book builds too.
my script aborts if /bin/sh is not bash, awk not gawk or yacc not bison.
if awk or yacc are scripts, i show a message to check the script.
tobias
#!/bin/bash
PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [ -d /root/devlop ]
then
PATH=/root/devlop:$PATH
fi
# Simple script to list version numbers of critical development tools
export LC_ALL=C
echo "bash >= 3.2 (4.2)
$( bash --version | head -n1 | cut -d" " -f2-4 )
/bin/sh MUST be a link to bash"
TMP=$( readlink -f /bin/sh )
[ ${TMP//bash} == ${TMP} ] && echo "!! ERROR : ${TMP}" && exit 99
echo " /bin/sh -> ${TMP}"
echo "binutils (ld) >= 2.17 (2.31.1)
$( ld --version | head -n1 )"
echo "bison >= 2.3 (2.7)
$( bison --version | head -n1 )"
TMP=
[ -e /usr/bin/yacc ] && TMP=/usr/bin/yacc
[ -e /bin/yacc ] && TMP=/bin/yacc
[ -z "${TMP}" ] && echo "!! ERROR : yacc not found" && exit 99
if [ -L ${TMP} ] ; then
echo "yacc should be a link to bison"
TMP2=$( readlink -f ${TMP} )
[ ${TMP2//bison} == ${TMP2} ] && echo "!! ERROR : ${TMP2}" && exit 99
echo " ${TMP} -> ${TMP2}"
else
echo "
!! IMPORTANT !!
check wether ${TMP} is a wapper script for bison
"
fi
echo "bzip2 >= 1.0.4 (1.0.6)
$( bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- )"
echo "coreutils (chown) >= 6.9 (8.20)
$( chown --version | head -n1 )"
echo "diffutils >= 2.8.1 (3.2)
$( diff --version | head -n1 )"
echo "findutils >= 4.2.31 (4.4.2)
$( find --version | head -n1 )"
echo "gawk >= 3.1.5 (4.0.2)
$( gawk --version | head -n1 )"
TMP=
[ -e /usr/bin/awk ] && TMP=/usr/bin/awk
[ -e /bin/awk ] && TMP=/bin/awk
[ -z "${TMP}" ] && echo "!! ERROR : awk not found" && exit 99
if [ -L ${TMP} ] ; then
echo "awk MUST be a link to gawk"
TMP2=$( readlink -f ${TMP} )
[ ${TMP2//gawk} == ${TMP2} ] && echo " ${TMP2} !! FAILURE !!" && exit 99
echo " ${TMP} -> ${TMP2}"
else
echo "
!! IMPORTANT !!
check wether ${TMP} is a wapper script for gawk (GNU awk)
"
fi
echo "gcc >= 4.1.2 (4.7.2)
$( gcc --version | head -n1 )"
echo "gcc compilation"
echo 'main(){}' > dummy.c
gcc -o dummy dummy.c >/dev/null
TMP=
[ -x dummy ] && TMP=ok
rm -f dummy dummy.c
[ -z "${TMP}" ] && echo "!! ERROR : gcc compilation failed" && exit 99
echo " Compilation OK"
echo "glibc (ldd) >= 2.5.1 (2.17)
$( ldd --version | head -n1 )"
echo "grep >= 2.5.1a (2.14)
$( grep --version | head -n1 )"
echo "gzip >= 1.3.12 (1.5)
$( gzip --version | head -n1 )"
echo "m4 >= 1.4.10 (1.4.16)
$( m4 --version | head -n1 )"
echo "make >= 3.81 (3.82)
$( make --version | head -n1 )"
echo "patch >= 2.5.4 (2.7.1)
$( patch --version | head -n1 )"
echo "Perl >= 5.8.8 (5.16.2)
$( perl -V:version )"
echo "sed >= 4.1.5 (4.2.2)
$( sed --version | head -n1 )"
echo "tar >= 1.18 (1.26)
$( tar --version | head -n1 )"
echo "texinfo (makeinfo) >= 4.9 (4.13a)
$( makeinfo --version | head -n1 )"
echo "xz >= 5.0.0 (5.0.4)
$( xz --version | head -n1 )"
echo "linux kernel >= 2.6.25 (3.7.1), compiled with gcc >= 4.1.2 (4.7.2)
$( cat /proc/version )"
bash >= 3.2 (4.2)
bash, version 4.2.39(2)-release
/bin/sh MUST be a link to bash
/bin/sh -> /bin/bash
binutils (ld) >= 2.17 (2.31.1)
GNU ld (GNU Binutils) 2.23.1
bison >= 2.3 (2.7)
bison (GNU Bison) 2.7
!! IMPORTANT !!
check wether /usr/bin/yacc is a wapper script for bison
bzip2 >= 1.0.4 (1.0.6)
bzip2, Version 1.0.6, 6-Sept-2010.
coreutils (chown) >= 6.9 (8.20)
chown (GNU coreutils) 8.19
diffutils >= 2.8.1 (3.2)
diff (GNU diffutils) 3.2
findutils >= 4.2.31 (4.4.2)
find (GNU findutils) 4.4.2
gawk >= 3.1.5 (4.0.2)
GNU Awk 4.0.1
awk MUST be a link to gawk
/usr/bin/awk -> /usr/bin/gawk
gcc >= 4.1.2 (4.7.2)
gcc (GCC) 4.7.2
gcc compilation
Compilation OK
glibc (ldd) >= 2.5.1 (2.17)
ldd (GNU libc) 2.16
grep >= 2.5.1a (2.14)
grep (GNU grep) 2.14
gzip >= 1.3.12 (1.5)
gzip 1.5
m4 >= 1.4.10 (1.4.16)
m4 (GNU M4) 1.4.16
make >= 3.81 (3.82)
GNU Make 3.82
patch >= 2.5.4 (2.7.1)
GNU patch 2.7.1
Perl >= 5.8.8 (5.16.2)
version='5.16.2';
sed >= 4.1.5 (4.2.2)
GNU sed version 4.2.1
tar >= 1.18 (1.26)
tar (GNU tar) 1.26
texinfo (makeinfo) >= 4.9 (4.13a)
makeinfo (GNU texinfo) 4.13
xz >= 5.0.0 (5.0.4)
xz (XZ Utils) 5.0.4
linux kernel >= 2.6.25 (3.7.1), compiled with gcc >= 4.1.2 (4.7.2)
Linux version 3.4.23-8-64 (root@mol-test) (gcc version 4.7.2 (GCC) ) #1 SMP
Thu Dec 20 03:01:05 CET 2012
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page