6.44. Patch-2.5.9

The Patch package contains a program for modifying or creating files by applying a “patch” file typically created by the diff program.

6.44.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.44.2. Installation of Patch

Configure would like to hardcode the full path to ed. When ed isn't found it falls back on just "ed". Since ed isn't installed by default but it may be installed on the host, Lets force the fallback value.

cat > config.cache << EOF
ac_cv_path_ed_PROGRAM=ed
EOF

Prepare Patch for compilation:

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

Compile the package:

make

Install the package:

make prefix=${CLFS}/usr install

6.44.3. Contents of Patch

Installed program: patch

Short Descriptions

patch

Modifies files according to a patch file. A patch file is normally a difference listing created with the diff program. By applying these differences to the original files, patch creates the patched versions.