- Timestamp:
- 03/05/2023 07:27:40 AM (15 months ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter02/hostreqs.xml
r5c3ffcb9 r90389c2 66 66 67 67 <listitem> 68 <para><emphasis role="strong">Coreutils- 6.9</emphasis></para>68 <para><emphasis role="strong">Coreutils-7.0</emphasis></para> 69 69 </listitem> 70 70 … … 157 157 <screen role="nodump"><userinput>cat > version-check.sh << "EOF" 158 158 <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 -> $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 -> `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(){}' > dummy.c && 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 164 LC_ALL=C 165 PATH=/usr/bin:/bin 166 167 bail() { echo "FATAL: $1"; exit 1; } 168 grep --version > /dev/null 2> /dev/null || bail "grep does not work" 169 sed '' /dev/null || bail "sed does not work" 170 sort /dev/null || bail "sort does not work" 171 172 ver_check() 173 { 174 if ! type -p $2 &>/dev/null 175 then 176 echo "ERROR: Cannot find $2 ($1)"; return 1; 177 fi 178 v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1) 179 if printf '%s\n' $3 $v | sort --version-sort --check &>/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 188 ver_kernel() 189 { 190 kver=$(uname -r | grep -E -o '[0-9\.]+') 191 if printf '%s\n' $1 $kver | sort --version-sort --check &>/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 201 ver_check Coreutils sort 7.0 || bail "--version-sort unsupported" 202 ver_check Bash bash 3.2 203 ver_check Binutils ld 2.13.1 204 ver_check Bison bison 2.7 205 ver_check Diffutils diff 2.8.1 206 ver_check Findutils find 4.2.31 207 ver_check Gawk gawk 4.0.1 208 ver_check GCC gcc 5.1 209 ver_check "GCC (C++)" g++ 5.1 210 ver_check Grep grep 2.5.1a 211 ver_check Gzip gzip 1.3.12 212 ver_check M4 m4 1.4.10 213 ver_check Make make 4.0 214 ver_check Patch patch 2.5.4 215 ver_check Perl perl 5.8.8 216 ver_check Python python3 3.4 217 ver_check Sed sed 4.1.5 218 ver_check Tar tar 1.22 219 ver_check Texinfo texi2any 4.7 220 ver_check Xz xz 5.0.0 221 ver_kernel &min-kernel; 222 223 alias_check() { 224 if $1 --version 2>&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 } 228 echo "Aliases:" 229 alias_check awk GNU 230 alias_check yacc Bison 231 alias_check sh Bash 232 233 echo "Compiler check:" 234 if printf "int main(){}" | g++ -x c++ - 235 then echo "OK: g++ works"; 236 else echo "ERROR: g++ does NOT work"; fi 237 rm -f a.out</literal> 212 238 EOF 213 239 214 240 bash version-check.sh</userinput></screen> 215 <!-- 216 <para>Also check for some library consistency:</para> 217 218 <screen role="nodump"><userinput>cat > library-check.sh << "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 232 242 </sect2> 233 243 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.