mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
q
This commit is contained in:
parent
779b798e5f
commit
140e9a445d
@ -165,78 +165,90 @@
|
|||||||
the ability to compile programs, run the following commands:</para>
|
the ability to compile programs, run the following commands:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>cat > version-check.sh << "EOF"
|
<screen role="nodump"><userinput>cat > version-check.sh << "EOF"
|
||||||
<literal>#!/bin/bash
|
<literal> #!/bin/bash
|
||||||
# Simple script to list version numbers of critical development tools
|
# A script to list version numbers of critical development tools
|
||||||
export LC_ALL=C
|
|
||||||
bash --version | head -n1 | cut -d" " -f2-4
|
|
||||||
MYSH=$(readlink -f /bin/sh)
|
|
||||||
echo "/bin/sh -> $MYSH"
|
|
||||||
echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash"
|
|
||||||
unset MYSH
|
|
||||||
|
|
||||||
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
|
# If you have tools installed in other directories, adjust PATH here AND
|
||||||
bison --version | head -n1
|
# in ~lfs/.bashrc (section 4.4) as well.
|
||||||
|
|
||||||
if [ -h /usr/bin/yacc ]; then
|
LC_ALL=C
|
||||||
echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
|
PATH=/usr/bin:/bin
|
||||||
elif [ -x /usr/bin/yacc ]; then
|
|
||||||
echo yacc is `/usr/bin/yacc --version | head -n1`
|
|
||||||
else
|
|
||||||
echo "yacc not found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
|
bail() { echo "FATAL: $1"; exit 1; }
|
||||||
diff --version | head -n1
|
grep --version > /dev/null 2> /dev/null || bail "grep does not work"
|
||||||
find --version | head -n1
|
sed '' /dev/null || bail "sed does not work"
|
||||||
gawk --version | head -n1
|
sort /dev/null || bail "sort does not work"
|
||||||
|
|
||||||
if [ -h /usr/bin/awk ]; then
|
ver_check()
|
||||||
echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
|
{
|
||||||
elif [ -x /usr/bin/awk ]; then
|
if ! type -p $2 &>/dev/null
|
||||||
echo awk is `/usr/bin/awk --version | head -n1`
|
then
|
||||||
else
|
echo "ERROR: Cannot find $2 ($1)"; return 1;
|
||||||
echo "awk not found"
|
fi
|
||||||
fi
|
v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+' | head -n1)
|
||||||
|
if printf '%s\n' $3 $v | sort --version-sort --check &>/dev/null
|
||||||
|
then
|
||||||
|
printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0;
|
||||||
|
else
|
||||||
|
printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1";
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
gcc --version | head -n1
|
ver_kernel()
|
||||||
g++ --version | head -n1
|
{
|
||||||
grep --version | head -n1
|
kver=$(uname -r | sed -E 's/^([0-9\.]+).*/\1/')
|
||||||
gzip --version | head -n1
|
if printf '%s\n' $1 $kver | sort --version-sort --check &>/dev/null
|
||||||
cat /proc/version
|
then
|
||||||
m4 --version | head -n1
|
printf "OK: Linux Kernel $kver >= $1\n"; return 0;
|
||||||
make --version | head -n1
|
else
|
||||||
patch --version | head -n1
|
printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver";
|
||||||
echo Perl `perl -V:version`
|
return 1;
|
||||||
python3 --version
|
fi
|
||||||
sed --version | head -n1
|
}
|
||||||
tar --version | head -n1
|
|
||||||
makeinfo --version | head -n1 # texinfo version
|
|
||||||
xz --version | head -n1
|
|
||||||
|
|
||||||
echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c
|
# Coreutils first because-sort needs Coreutils >= 7.0
|
||||||
if [ -x dummy ]
|
ver_check Coreutils sort 7.0 || bail "--version-sort unsupported"
|
||||||
then echo "g++ compilation OK";
|
ver_check Bash bash 3.2
|
||||||
else echo "g++ compilation failed"; fi
|
ver_check Binutils ld 2.13.1
|
||||||
rm -f dummy.c dummy</literal>
|
ver_check Bison bison 2.7
|
||||||
|
ver_check Diffutils diff 2.8.1
|
||||||
|
ver_check Findutils find 4.2.31
|
||||||
|
ver_check Gawk gawk 4.0.1
|
||||||
|
ver_check GCC gcc 5.1
|
||||||
|
ver_check "GCC (C++)" g++ 5.1
|
||||||
|
ver_check Grep grep 2.6.1
|
||||||
|
ver_check Gzip gzip 1.3.12
|
||||||
|
ver_check M4 m4 1.4.10
|
||||||
|
ver_check Make make 4.0
|
||||||
|
ver_check Patch patch 2.5.4
|
||||||
|
ver_check Perl perl 5.8.8
|
||||||
|
ver_check Python python3 3.4
|
||||||
|
ver_check Sed sed 4.1.5
|
||||||
|
ver_check Tar tar 1.22
|
||||||
|
ver_check Texinfo texi2any 4.7
|
||||||
|
ver_check Xz xz 5.0.0
|
||||||
|
#ver_check "Linux Kernel" "" 3.2 'cat /proc/version'
|
||||||
|
ver_kernel 3.2
|
||||||
|
|
||||||
|
alias_check() {
|
||||||
|
if $1 --version 2>&1 | grep -qi $2
|
||||||
|
then printf "OK: %-4s is $2\n" "$1";
|
||||||
|
else printf "ERROR: %-4s is NOT $2\n" "$1"; fi
|
||||||
|
}
|
||||||
|
echo "Aliases:"
|
||||||
|
alias_check awk GNU
|
||||||
|
alias_check yacc Bison
|
||||||
|
alias_check sh Bash
|
||||||
|
|
||||||
|
echo "Compiler check"
|
||||||
|
if printf "int main(){}" | g++ -x c++ -
|
||||||
|
then echo "OK: g++ works";
|
||||||
|
else echo "ERROR: g++ does NOT work"; fi
|
||||||
|
rm -f a.out</literal>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
bash version-check.sh</userinput></screen>
|
bash version-check.sh</userinput></screen>
|
||||||
<!--
|
|
||||||
<para>Also check for some library consistency:</para>
|
|
||||||
|
|
||||||
<screen role="nodump"><userinput>cat > library-check.sh << "EOF"
|
|
||||||
<literal>#!/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</literal>
|
|
||||||
EOF
|
|
||||||
|
|
||||||
bash library-check.sh</userinput></screen>
|
|
||||||
|
|
||||||
<para>The files identified by this script should be all present
|
|
||||||
or all absent, but not only one or two present.</para>
|
|
||||||
-->
|
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
<!ENTITY % rc "IGNORE"> <!-- set to INCLUDE for rc,
|
<!ENTITY % rc "IGNORE"> <!-- set to INCLUDE for rc,
|
||||||
set to IGNORE for development or
|
set to IGNORE for development or
|
||||||
release -->
|
release -->
|
||||||
<!ENTITY % relnum "11.1"><!-- must be given for release or rc -->
|
<!ENTITY % relnum "11.3"><!-- must be given for release or rc -->
|
||||||
<!ENTITY % reldate "March 1st, 2022"><!-- must ve given for release or rc -->
|
<!ENTITY % reldate "March 1st, 2023"><!-- must ve given for release or rc -->
|
||||||
<!ENTITY % crdate "1999-2022"><!-- must ve given for release or rc -->
|
<!ENTITY % crdate "1999-2022"><!-- must ve given for release or rc -->
|
||||||
<!ENTITY % rcnum "2"><!-- must be given only for rc -->
|
<!ENTITY % rcnum "0"><!-- must be given only for rc -->
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<!-- Do not change anything below unless the www or book layouts change -->
|
<!-- Do not change anything below unless the www or book layouts change -->
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user