C.4 Specific advice for GNU/Linux systems

If you are installing the GNU C Library on GNU/Linux systems, you need to have
the header files from a 2.6.32 or newer kernel around for reference.
These headers must be installed using ‘make headers_install’; the
headers present in the kernel source directory are not suitable for
direct use by the GNU C Library. You do not need to use that kernel, just have
its headers installed where the GNU C Library can access them, referred to here as
install-directory. The easiest way to do this is to unpack it
in a directory such as /usr/src/linux-version. In that
directory, run ‘make headers_install
INSTALL_HDR_PATH=install-directory’. Finally, configure the GNU C Library
with the option ‘--with-headers=install-directory/include’.
Use the most recent kernel you can get your hands on. (If you are
cross-compiling the GNU C Library, you need to specify
‘ARCH=architecture’ in the ‘make headers_install’
command, where architecture is the architecture name used by the
Linux kernel, such as ‘x86’ or ‘powerpc’.)

After installing the GNU C Library, you may need to remove or rename
directories such as /usr/include/linux and
/usr/include/asm, and replace them with copies of directories
such as linux and asm from
install-directory/include. All directories present in
install-directory/include should be copied, except that
the GNU C Library provides its own version of /usr/include/scsi; the
files provided by the kernel should be copied without replacing those
provided by the GNU C Library. The linux, asm and
asm-generic directories are required to compile programs using
the GNU C Library; the other directories describe interfaces to the kernel but
are not required if not compiling programs using those interfaces.
You do not need to copy kernel headers if you did not specify an
alternate kernel header source using ‘--with-headers’.

The Filesystem Hierarchy Standard for GNU/Linux systems expects some
components of the GNU C Library installation to be in
/lib and some in /usr/lib. This is handled automatically
if you configure the GNU C Library with ‘--prefix=/usr’. If you set some other
prefix or allow it to default to /usr/local, then all the
components are installed there.