5.15. Coreutils-6.9

The Coreutils package contains utilities for showing and setting the basic system characteristics.

User Notes: http://wiki.linuxfromscratch.org/hlfs/wiki/coreutils

5.15.1. Installation of Coreutils

The version of the function “futimens” used by Coreutils is incompatible with the version that current Glibc provides, so we'll rename the function:

for file in src/{copy,touch}.c lib/utimens.{c,h} ; do \
   cp -v $file{,.orig}
   sed 's/futimens/gl_&/' $file.orig > $file
done

GCC-4.2.1 will cause a lot of warnings because of new coding standards. Fix this in Coreutils with the following commands:

cp -v configure{,.orig}
sed 's/-std=gnu99/-std=gnu89/' configure.orig  > configure

Prepare Coreutils for compilation:

./configure --prefix=/tools

Compile the package:

make

Install the package:

make install

The su program was not installed because make install needs to be run as root to install su with suid permission. We will need su in the next chapter, but it will be executed by root and so will not need the suid permission. Furthermore, to prevent this su from accidentally being used on the host system it will be renamed. Install su with the following command:

install -v src/su /tools/bin/tools-su

Details on this package are located in Section 6.17.2, “Contents of Coreutils.”