<< Back to man.ChinaUnix.net

5.22. Grep-2.5.1

The Grep package contains programs for searching through files.

Approximate build time: 0.1 SBU

Required disk space: 5.8 MB

Grep installation depends on: Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Make, Sed, and Texinfo

5.22.1. Installation of Grep

Prepare Grep for compilation:

./configure --prefix=/tools \
    --disable-perl-regexp --with-included-regex

The meaning of the configure options:


This makes sure that the grep program does not get linked against a Perl Compatible Regular Expression (PCRE) library that may be present on the host and would not be available once we enter the chroot environment.


This ensures that Grep uses its internal regular expression code. Without this switch, Grep will use the code from Glibc, which is known to be buggy.

Compile the package:


To test the results, issue: make check.

Install the package:

make install

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