5.33. Util-linux-2.26

The Util-linux package contains miscellaneous utility programs.

Approximate build time: 0.6 SBU
Required disk space: 139 MB

5.33.1. Installation of Util-linux

5.33.2. 32-bit Installation

Prepare Util-linux for 32-bit compilation:

./configure --prefix=/                     \
            --libdir=/tools/lib32          \
            --bindir=/tools/bin            \
            --sbindir=/tools/sbin          \
            --includedir=/tools/include    \
            --datarootdir=/tools/share     \
            --without-python               \
            --disable-makeinstall-chown    \
            --without-systemdsystemunitdir \
            CC="gcc -m32"                  \
            LDFLAGS=-lpthread              \
            PKG_CONFIG=""

The meaning of the configure option:

--without-python

This switch disables using Python if it is installed on the host system. It avoids trying to build unneeded bindings.

--disable-makeinstall-chown

This switch disables using the chown command during installation. This is not needed when installing into the /tools directory and avoids the necessity of installing as root.

--without-systemdsystemunitdir

On systems that use systemd, the package tries to install a systemd specific file to a non-existent directory in /tools. This switch disables the unnecessary action.

PKG_CONFIG=""

Setting this envronment variable prevents adding unneeded features that may be available on the host. Note that the location shown for setting this environment variable is different from other LFS sections where variables are set preceding the command. This location is shown to demonstrate an alternative way of setting an environment variable when using configure.

LDFLAGS=-lpthread

Forces the linker to include the libpthread library, to fix a build error.

Compile the package:

make

Install the package:

make usrbin_execdir=/tools/bin usrsbin_execdir=/tools/sbin install

Clean up the build directory before moving on to the next platform:

make clean

5.33.3. x32 ABI Installation

Prepare Util-linux for x32 ABI compilation:

./configure --prefix=/                     \
            --libdir=/tools/libx32          \
            --bindir=/tools/bin            \
            --sbindir=/tools/sbin          \
            --includedir=/tools/include    \
            --datarootdir=/tools/share     \
            --without-python               \
            --disable-makeinstall-chown    \
            --without-systemdsystemunitdir \
            CC="gcc -mx32"                 \
            LDFLAGS=-lpthread              \
            PKG_CONFIG=""

The meaning of the configure option:

--without-python

This switch disables using Python if it is installed on the host system. It avoids trying to build unneeded bindings.

--disable-makeinstall-chown

This switch disables using the chown command during installation. This is not needed when installing into the /tools directory and avoids the necessity of installing as root.

--without-systemdsystemunitdir

On systems that use systemd, the package tries to install a systemd specific file to a non-existent directory in /tools. This switch disables the unnecessary action.

PKG_CONFIG=""

Setting this envronment variable prevents adding unneeded features that may be available on the host. Note that the location shown for setting this environment variable is different from other LFS sections where variables are set preceding the command. This location is shown to demonstrate an alternative way of setting an environment variable when using configure.

LDFLAGS=-lpthread

Forces the linker to include the libpthread library, to fix a build error.

Compile the package:

make

Install the package:

make usrbin_execdir=/tools/bin usrsbin_execdir=/tools/sbin install

Clean up the build directory before moving on to the next platform:

make clean

5.33.4. 64-bit Installation

Prepare Util-linux for 64-bit compilation:

./configure --prefix=/tools                \
            --without-python               \
            --disable-makeinstall-chown    \
            --without-systemdsystemunitdir \
            PKG_CONFIG=""

The meaning of the configure option:

--without-python

This switch disables using Python if it is installed on the host system. It avoids trying to build unneeded bindings.

--disable-makeinstall-chown

This switch disables using the chown command during installation. This is not needed when installing into the /tools directory and avoids the necessity of installing as root.

--without-systemdsystemunitdir

On systems that use systemd, the package tries to install a systemd specific file to a non-existent directory in /tools. This switch disables the unnecessary action.

PKG_CONFIG=""

Setting this envronment variable prevents adding unneeded features that may be available on the host. Note that the location shown for setting this environment variable is different from other LFS sections where variables are set preceding the command. This location is shown to demonstrate an alternative way of setting an environment variable when using configure.

Compile the package:

make

Install the package:

make install