5.5. Installing Diffutils

5.5.1. Installation of Diffutils

Install Diffutils by running the following commands:


export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&
./configure --prefix=$LFS/usr --disable-nls &&
unset CPPFLAGS &&
make LDFLAGS=-static &&
make install

5.5.2. Command explanations

CPPFLAGS=-Dre_max_failures=re_max_failures2: The CPPFLAGS variable is a variable that's read by the cpp program (C PreProcessor). The value of this variable tells the preprocessor to replace every instance of re_max_failures it finds by re_max_failures2 before handing the souce file to the compiler itself for compilation. This package has problems linking statically on certain platforms (depending on the Glibc version used on that system) and this construction fixes that problem.

5.5.3. Contents

The Diffutils package contains the cmp, diff, diff3 and sdiff programs.

5.5.4. Description

5.5.4.1. cmp and diff

cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.

5.5.4.2. diff3

The difference between diff and diff3 is that diff comprares 2 files, diff3 compares 3 files.

5.5.4.3. sdiff

sdiff merges two two files and interactively outputs the results.