Estimated build time: 1 minute Estimated required disk space: 4 MB |
When installing Grep using glibc-2.1.x on your base system, it may be necessary to use a fix to prevent a variable name conflict. The following commands can be used in this case. Note that these commands can also be used for other glibc versions so if you aren't sure, then use the first version.
export CPPFLAGS=-Dre_max_failures=re_max_failures2 && ./configure --prefix=$LFS/usr --disable-nls --bindir=$LFS/bin && unset CPPFLAGS && make LDFLAGS=-static && make install |
If you are using a newer glibc version (2.2.x), you can use the following commands to install Grep:
./configure --prefix=$LFS/usr --disable-nls \ ���--bindir=$LFS/bin && make LDFLAGS=-static && make install |
egrep, fgrep and grep
egrep prints lines from files matching an extended regular expression pattern.
fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.
grep prints lines from files matching a basic regular expression pattern.
Grep-2.4.2 needs the following to be installed:
bash: sh
binutils: ar, as, ld
diffutils: cmp
fileutils: chmod, cp, ln, ls, mkdir, rm
gcc: cc
grep: egrep, grep
make: make
sed: sed
sh-utils: basename, expr, sleep, uname
textutils: cat, tr