bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU GREP - --program-prefix failure and gmake check failures


From: Albert Chin
Subject: Re: GNU GREP - --program-prefix failure and gmake check failures
Date: Wed, 27 Mar 2002 07:55:12 -0600
User-agent: Mutt/1.2.5i

On Thu, Mar 28, 2002 at 12:33:22AM +1100, Peter Bray wrote:
> 
> GNU GREP 2.5 / Solaris 8 INTEL / GCC 3.0.2
> 
> [...]
> 
> 3. ./configure --prefix=/pkgs/grep-2.5 --program-prefix=g
>    Results in the installation of 
>         - ggrep (correct)
>         - egrep -> grep (incorrect - should be gegrep -> ggrep)
>         - fgrep -> grep (incorrect - should be gegrep -> ggrep)
>    Manual Pages are correct
> 
> 4. Renaming egrep to gegrep and correcting the symlink to ggrep
>    Renaming fgrep to gfgrep and correcting the symlink to ggrep
> 
>    Run gegrep now and it does not understand that it is running 
>    in egrep mode and not grep mode, thus extended regexps are 
>    ignored. gegrep -E as expected does work. This bug did not exist 
>    in GNU GREP 2.4.2, unfortunaely the ignore case problem with 
>    egrep (example '^[A-Z ]+$' matches lowercase letters) has caused
>    as to upgrade to 2.5 which fixes the problem.

Attached is a patch to address this. Paul Eggert submitted a patch to
address the same issue. My patch is based on his work.

-- 
albert chin (address@hidden)

-- snip snip
--- src/Makefile.am.orig        Sun Mar 17 23:51:48 2002
+++ src/Makefile.am     Mon Mar 18 08:57:47 2002
@@ -4,12 +4,12 @@
 LN = ln
 
 bin_PROGRAMS = grep
+bin_SCRIPTS = egrep fgrep
 grep_SOURCES = grep.c dfa.c kwset.c search.c \
                grepmat.c
 noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h
 
 LDADD = @INTLLIBS@ ../lib/libgreputils.a
-datadir = $(prefix)/@DATADIRNAME@
 localedir = $(datadir)/locale
 INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\"
 
@@ -17,6 +17,12 @@
              dosbuf.c \
              vms_fab.c vms_fab.h
 
-install-exec-local:
-       @SYMLINK@ @SYMLINKFROM@ $(bindir)/egrep
-       @SYMLINK@ @SYMLINKFROM@ $(bindir)/fgrep
+egrep:
+       echo '#! /bin/sh' >$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -E $${1+"$$@"}' 
>>$@
+       chmod a+x $@
+
+fgrep:
+       echo '#! /bin/sh' >$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -F $${1+"$$@"}' 
>>$@
+       chmod a+x $@
--- configure.in.orig   Sun Mar 17 22:55:07 2002
+++ configure.in        Mon Mar 18 08:44:00 2002
@@ -134,35 +134,13 @@
 
 # support for pcre
 if test x"$testpcre" = x"yes"; then
-       if pcre-config --cflags >/dev/null 2>&1; then
-               CFLAGS="$CFLAGS `pcre-config --cflags`"
-               LIBS="$LIBS `pcre-config --libs`"
-       fi
-       AC_CHECK_LIB(pcre, pcre_exec)
-fi
+       AC_PATH_PROG(PCRE_CONFIG, pcre-config)
 
-dnl Check how to create the {e,f}grep links
-AC_MSG_CHECKING([How to create links])
-rm -f test00 test01
-touch test00
-ln -s test00 test01 || :
-SYMLINK=""
-SYMLINKFROM="grep"
-if test -L test01; then
-       SYMLINK="ln -s"
-else
-       SYMLINKFROM="${bindir}/grep"
-       rm -f test01
-       ln test00 test01 || :
-       if test -e test01; then
-               SYMLINK="ln"
-       else
-               SYMLINK="cp"
+       if ($PCRE_CONFIG --cflags) >/dev/null 2>&1; then
+               CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags`"
+               LIBS="$LIBS `$PCRE_CONFIG --libs`"
        fi
+       AC_CHECK_LIB(pcre, pcre_exec)
 fi
-AC_MSG_RESULT($SYMLINK)
-AC_SUBST(SYMLINK)
-AC_SUBST(SYMLINKFROM)
-rm -f test00 test01
 
 AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile 
po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile 
bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > 
po/Makefile; echo timestamp > stamp-h])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]