Changeset 90389c2 for chapter02


Ignore:
Timestamp:
03/05/2023 07:27:40 AM (15 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
xry111/clfs-ng
Children:
a33431c
Parents:
5c3ffcb9 (diff), 271c856 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/trunk' into xry111/clfs-ng

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter02/hostreqs.xml

    r5c3ffcb9 r90389c2  
    6666
    6767    <listitem>
    68       <para><emphasis role="strong">Coreutils-6.9</emphasis></para>
     68      <para><emphasis role="strong">Coreutils-7.0</emphasis></para>
    6969    </listitem>
    7070
     
    157157<screen role="nodump"><userinput>cat &gt; version-check.sh &lt;&lt; "EOF"
    158158<literal>#!/bin/bash
    159 # Simple script to list version numbers of critical development tools
    160 export LC_ALL=C
    161 bash --version | head -n1 | cut -d" " -f2-4
    162 MYSH=$(readlink -f /bin/sh)
    163 echo "/bin/sh -&gt; $MYSH"
    164 echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash"
    165 unset MYSH
    166 
    167 bc --version | head -n1
    168 echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
    169 bison --version | head -n1
    170 
    171 if [ -h /usr/bin/yacc ]; then
    172   echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
    173 elif [ -x /usr/bin/yacc ]; then
    174   echo yacc is `/usr/bin/yacc --version | head -n1`
    175 else
    176   echo "yacc not found"
    177 fi
    178 
    179 echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
    180 diff --version | head -n1
    181 find --version | head -n1
    182 gawk --version | head -n1
    183 
    184 if [ -h /usr/bin/awk ]; then
    185   echo "/usr/bin/awk -&gt; `readlink -f /usr/bin/awk`";
    186 elif [ -x /usr/bin/awk ]; then
    187   echo awk is `/usr/bin/awk --version | head -n1`
    188 else
    189   echo "awk not found"
    190 fi
    191 
    192 gcc --version | head -n1
    193 g++ --version | head -n1
    194 grep --version | head -n1
    195 gzip --version | head -n1
    196 cat /proc/version
    197 m4 --version | head -n1
    198 make --version | head -n1
    199 patch --version | head -n1
    200 echo Perl `perl -V:version`
    201 python3 --version
    202 sed --version | head -n1
    203 tar --version | head -n1
    204 makeinfo --version | head -n1  # texinfo version
    205 xz --version | head -n1
    206 
    207 echo 'int main(){}' &gt; dummy.c &amp;&amp; g++ -o dummy dummy.c
    208 if [ -x dummy ]
    209   then echo "g++ compilation OK";
    210   else echo "g++ compilation failed"; fi
    211 rm -f dummy.c dummy</literal>
     159# A script to list version numbers of critical development tools
     160
     161# If you have tools installed in other directories, adjust PATH here AND
     162# in ~lfs/.bashrc (section 4.4) as well.
     163
     164LC_ALL=C
     165PATH=/usr/bin:/bin
     166
     167bail() { echo "FATAL: $1"; exit 1; }
     168grep --version > /dev/null 2> /dev/null || bail "grep does not work"
     169sed '' /dev/null || bail "sed does not work"
     170sort   /dev/null || bail "sort does not work"
     171
     172ver_check()
     173{
     174   if ! type -p $2 &amp;>/dev/null
     175   then
     176     echo "ERROR: Cannot find $2 ($1)"; return 1;
     177   fi
     178   v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
     179   if printf '%s\n' $3 $v | sort --version-sort --check &amp;>/dev/null
     180   then
     181     printf "OK:    %-9s %-6s >= $3\n" "$1" "$v"; return 0;
     182   else
     183     printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1";
     184     return 1;
     185   fi
     186}
     187
     188ver_kernel()
     189{
     190   kver=$(uname -r | grep -E -o '[0-9\.]+')
     191   if printf '%s\n' $1 $kver | sort --version-sort --check &amp;>/dev/null
     192   then
     193     printf "OK:    Linux Kernel $kver >= $1\n"; return 0;
     194   else
     195     printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver";
     196     return 1;
     197   fi
     198}
     199
     200# Coreutils first because-sort needs Coreutils >= 7.0
     201ver_check Coreutils      sort     7.0 || bail "--version-sort unsupported"
     202ver_check Bash           bash     3.2
     203ver_check Binutils       ld       2.13.1
     204ver_check Bison          bison    2.7
     205ver_check Diffutils      diff     2.8.1
     206ver_check Findutils      find     4.2.31
     207ver_check Gawk           gawk     4.0.1
     208ver_check GCC            gcc      5.1
     209ver_check "GCC (C++)"    g++      5.1
     210ver_check Grep           grep     2.5.1a
     211ver_check Gzip           gzip     1.3.12
     212ver_check M4             m4       1.4.10
     213ver_check Make           make     4.0
     214ver_check Patch          patch    2.5.4
     215ver_check Perl           perl     5.8.8
     216ver_check Python         python3  3.4
     217ver_check Sed            sed      4.1.5
     218ver_check Tar            tar      1.22
     219ver_check Texinfo        texi2any 4.7
     220ver_check Xz             xz       5.0.0
     221ver_kernel &min-kernel;
     222
     223alias_check() {
     224   if $1 --version 2>&amp;1 | grep -qi $2
     225   then printf "OK:    %-4s is $2\n" "$1";
     226   else printf "ERROR: %-4s is NOT $2\n" "$1"; fi
     227}
     228echo "Aliases:"
     229alias_check awk GNU
     230alias_check yacc Bison
     231alias_check sh Bash
     232
     233echo "Compiler check:"
     234if printf "int main(){}" | g++ -x c++ -
     235then echo "OK:    g++ works";
     236else echo "ERROR: g++ does NOT work"; fi
     237rm -f a.out</literal>
    212238EOF
    213239
    214240bash version-check.sh</userinput></screen>
    215 <!--
    216   <para>Also check for some library consistency:</para>
    217 
    218 <screen role="nodump"><userinput>cat &gt; library-check.sh &lt;&lt; "EOF"
    219 <literal>#!/bin/bash
    220 for lib in lib{gmp,mpfr,mpc}.la; do
    221   echo $lib: $(if find /usr/lib* -name $lib|
    222                grep -q $lib;then :;else echo not;fi) found
    223 done
    224 unset lib</literal>
    225 EOF
    226 
    227 bash library-check.sh</userinput></screen>
    228 
    229 <para>The files identified by this script should be all present
    230 or all absent, but not only one or two present.</para>
    231 -->
     241
    232242 </sect2>
    233243</sect1>
Note: See TracChangeset for help on using the changeset viewer.