6.22. Grep-2.8

The Grep package contains programs for searching through files.

6.22.1. Installation of Grep

When cross compiling, the configure script does not determine the correct values for the following. Set the values manually:

cat > config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF

Prepare Grep for compilation:

CC="${CC} ${BUILD64}" ./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --disable-perl-regexp --without-included-regex \
    --cache-file=config.cache

The meaning of the configure options:

--disable-perl-regexp

This ensures that the grep program does not get linked against a Perl Compatible Regular Expression (PCRE) library that may be present on the host but will not be available when building the final system.

--without-included-regex

When cross-compiling, Grep's configure assumes there is no usable regex.h installed and instead uses the one included with Grep. This switch forces the use of the regex functions from EGLIBC.

Compile the package:

make

Install the package:

make install

Details on this package are located in Section 10.63.2, “Contents of Grep.”