6.30. Diffutils-2.8.7

The Diffutils package contains programs that show the differences between files or directories.

6.30.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.30.2. Installation of Diffutils

This patch adds support for Internationalization:

patch -Np1 -i ../diffutils-2.8.7-i18n-1.patch

Prepare Diffutils for compilation:

./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr

Diffutils wants ed as the default editor, the following sed will allow us to use vim:

sed -i 's@\(^#define DEFAULT_EDITOR_PROGRAM \).*@\1"vi"@' config.h

Diffutils man-pages want to be recreated, but it requires help2man. So we update the time on the files to prevent them from being recreated:

touch man/*.1

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install

6.30.3. Contents of Diffutils

Installed programs: cmp, diff, diff3, and sdiff

Short Descriptions

cmp

Compares two files and reports whether or in which bytes they differ

diff

Compares two files or directories and reports which lines in the files differ

diff3

Compares three files line by line

sdiff

Merges two files and interactively outputs the results