Changeset 4e897cf for chapter02/hostreqs.xml
- Timestamp:
- 03/05/2023 10:14:49 AM (7 months ago)
- Branches:
- multilib
- Children:
- d09e490
- Parents:
- d8bc5bd (diff), 73e2b9c (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
rd8bc5bd r4e897cf 166 166 167 167 <screen role="nodump"><userinput>cat > version-check.sh << "EOF" 168 <literal>#!/bin/bash 169 # Simple script to list version numbers of critical development tools 170 export LC_ALL=C 171 bash --version | head -n1 | cut -d" " -f2-4 172 MYSH=$(readlink -f /bin/sh) 173 echo "/bin/sh -> $MYSH" 174 echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash" 175 unset MYSH 176 177 echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- 178 bison --version | head -n1 179 180 if [ -h /usr/bin/yacc ]; then 181 echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; 182 elif [ -x /usr/bin/yacc ]; then 183 echo yacc is `/usr/bin/yacc --version | head -n1` 184 else 185 echo "yacc not found" 186 fi 187 188 echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 189 diff --version | head -n1 190 find --version | head -n1 191 gawk --version | head -n1 192 193 if [ -h /usr/bin/awk ]; then 194 echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; 195 elif [ -x /usr/bin/awk ]; then 196 echo awk is `/usr/bin/awk --version | head -n1` 197 else 198 echo "awk not found" 199 fi 200 201 gcc --version | head -n1 202 g++ --version | head -n1 203 grep --version | head -n1 204 gzip --version | head -n1 205 cat /proc/version 206 m4 --version | head -n1 207 make --version | head -n1 208 patch --version | head -n1 209 echo Perl `perl -V:version` 210 python3 --version 211 sed --version | head -n1 212 tar --version | head -n1 213 makeinfo --version | head -n1 # texinfo version 214 xz --version | head -n1 215 216 echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c 217 if [ -x dummy ] 218 then echo "g++ compilation OK"; 219 else echo "g++ compilation failed"; fi 220 rm -f dummy.c dummy</literal> 168 <literal> #!/bin/bash 169 # A script to list version numbers of critical development tools 170 171 # If you have tools installed in other directories, adjust PATH here AND 172 # in ~lfs/.bashrc (section 4.4) as well. 173 174 LC_ALL=C 175 PATH=/usr/bin:/bin 176 177 bail() { echo "FATAL: $1"; exit 1; } 178 grep --version > /dev/null 2> /dev/null || bail "grep does not work" 179 sed '' /dev/null || bail "sed does not work" 180 sort /dev/null || bail "sort does not work" 181 182 ver_check() 183 { 184 if ! type -p $2 &>/dev/null 185 then 186 echo "ERROR: Cannot find $2 ($1)"; return 1; 187 fi 188 v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+' | head -n1) 189 if printf '%s\n' $3 $v | sort --version-sort --check &>/dev/null 190 then 191 printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0; 192 else 193 printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1"; 194 return 1; 195 fi 196 } 197 198 ver_kernel() 199 { 200 kver=$(uname -r | sed -E 's/^([0-9\.]+).*/\1/') 201 if printf '%s\n' $1 $kver | sort --version-sort --check &>/dev/null 202 then 203 printf "OK: Linux Kernel $kver >= $1\n"; return 0; 204 else 205 printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver"; 206 return 1; 207 fi 208 } 209 210 # Coreutils first because-sort needs Coreutils >= 7.0 211 ver_check Coreutils sort 7.0 || bail "--version-sort unsupported" 212 ver_check Bash bash 3.2 213 ver_check Binutils ld 2.13.1 214 ver_check Bison bison 2.7 215 ver_check Diffutils diff 2.8.1 216 ver_check Findutils find 4.2.31 217 ver_check Gawk gawk 4.0.1 218 ver_check GCC gcc 5.1 219 ver_check "GCC (C++)" g++ 5.1 220 ver_check Grep grep 2.6.1 221 ver_check Gzip gzip 1.3.12 222 ver_check M4 m4 1.4.10 223 ver_check Make make 4.0 224 ver_check Patch patch 2.5.4 225 ver_check Perl perl 5.8.8 226 ver_check Python python3 3.4 227 ver_check Sed sed 4.1.5 228 ver_check Tar tar 1.22 229 ver_check Texinfo texi2any 4.7 230 ver_check Xz xz 5.0.0 231 #ver_check "Linux Kernel" "" 3.2 'cat /proc/version' 232 ver_kernel 3.2 233 234 alias_check() { 235 if $1 --version 2>&1 | grep -qi $2 236 then printf "OK: %-4s is $2\n" "$1"; 237 else printf "ERROR: %-4s is NOT $2\n" "$1"; fi 238 } 239 echo "Aliases:" 240 alias_check awk GNU 241 alias_check yacc Bison 242 alias_check sh Bash 243 244 echo "Compiler check" 245 if printf "int main(){}" | g++ -x c++ - 246 then echo "OK: g++ works"; 247 else echo "ERROR: g++ does NOT work"; fi 248 rm -f a.out</literal> 221 249 EOF 222 250 223 251 bash version-check.sh</userinput></screen> 224 <!--225 <para>Also check for some library consistency:</para>226 227 <screen role="nodump"><userinput>cat > library-check.sh << "EOF"228 <literal>#!/bin/bash229 for lib in lib{gmp,mpfr,mpc}.la; do230 echo $lib: $(if find /usr/lib* -name $lib|231 grep -q $lib;then :;else echo not;fi) found232 done233 unset lib</literal>234 EOF235 236 bash library-check.sh</userinput></screen>237 238 <para>The files identified by this script should be all present239 or all absent, but not only one or two present.</para>240 -->241 252 242 253 <para arch="ml_32,ml_x32,ml_all"> … … 261 272 262 273 </sect2> 274 263 275 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.