diff -rc -N grep-2.5.4.orig/Makefile.in grep-2.5.4/Makefile.in
*** grep-2.5.4.orig/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 47,56 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
--- 47,57 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
***************
*** 142,147 ****
--- 143,149 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 192,197 ****
--- 194,201 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/aclocal.m4 grep-2.5.4/aclocal.m4
*** grep-2.5.4.orig/aclocal.m4	2009-02-10 04:35:24.000000000 +0000
--- grep-2.5.4/aclocal.m4	2009-05-15 06:56:44.000000000 +0000
***************
*** 821,826 ****
--- 821,827 ----
  m4_include([m4/malloc.m4])
  m4_include([m4/mbstate_t.m4])
  m4_include([m4/missing.m4])
+ m4_include([m4/pkg.m4])
  m4_include([m4/progtest.m4])
  m4_include([m4/realloc.m4])
  m4_include([m4/regex.m4])
diff -rc -N grep-2.5.4.orig/bootstrap/Makefile.in grep-2.5.4/bootstrap/Makefile.in
*** grep-2.5.4.orig/bootstrap/Makefile.in	2009-02-10 04:35:27.000000000 +0000
--- grep-2.5.4/bootstrap/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 43,52 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 43,53 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 114,119 ****
--- 115,121 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 164,169 ****
--- 166,173 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/configure grep-2.5.4/configure
*** grep-2.5.4.orig/configure	2009-02-10 04:35:29.000000000 +0000
--- grep-2.5.4/configure	2009-05-15 06:56:44.000000000 +0000
***************
*** 729,734 ****
--- 729,737 ----
  MKINSTALLDIRS
  INTL_LIBTOOL_SUFFIX_PREFIX
  SEP
+ PKG_CONFIG
+ pcre_CFLAGS
+ pcre_LIBS
  LTLIBOBJS'
  ac_subst_files=''
        ac_precious_vars='build_alias
***************
*** 739,745 ****
  LDFLAGS
  LIBS
  CPPFLAGS
! CPP'
  
  
  # Initialize some variables set by options.
--- 742,751 ----
  LDFLAGS
  LIBS
  CPPFLAGS
! CPP
! PKG_CONFIG
! pcre_CFLAGS
! pcre_LIBS'
  
  
  # Initialize some variables set by options.
***************
*** 1344,1349 ****
--- 1350,1358 ----
    CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
                you have headers in a nonstandard directory <include dir>
    CPP         C preprocessor
+   PKG_CONFIG  path to pkg-config utility
+   pcre_CFLAGS C compiler flags for pcre, overriding pkg-config
+   pcre_LIBS   linker flags for pcre, overriding pkg-config
  
  Use these variables to override the choices made by `configure' or to help
  it to find libraries and programs with nonstandard names/locations.
***************
*** 10623,10703 ****
  
  # support for pcre
  if test x"$testpcre" = x"yes"; then
- 	if pcre-config --cflags >/dev/null 2>&1; then
- 		CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
- 		LIBS="$LIBS `pcre-config --libs`"
- 	fi
  
! { echo "$as_me:$LINENO: checking for pcre_exec in -lpcre" >&5
! echo $ECHO_N "checking for pcre_exec in -lpcre... $ECHO_C" >&6; }
! if test "${ac_cv_lib_pcre_pcre_exec+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
!   ac_check_lib_save_LIBS=$LIBS
! LIBS="-lpcre  $LIBS"
! cat >conftest.$ac_ext <<_ACEOF
! /* confdefs.h.  */
! _ACEOF
! cat confdefs.h >>conftest.$ac_ext
! cat >>conftest.$ac_ext <<_ACEOF
! /* end confdefs.h.  */
  
! /* Override any GCC internal prototype to avoid an error.
!    Use char because int might match the return type of a GCC
!    builtin and then its argument prototype would still apply.  */
! #ifdef __cplusplus
! extern "C"
! #endif
! char pcre_exec ();
! int
! main ()
! {
! return pcre_exec ();
!   ;
!   return 0;
! }
! _ACEOF
! rm -f conftest.$ac_objext conftest$ac_exeext
! if { (ac_try="$ac_link"
! case "(($ac_try" in
!   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
!   *) ac_try_echo=$ac_try;;
  esac
! eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
!   (eval "$ac_link") 2>conftest.er1
!   ac_status=$?
!   grep -v '^ *+' conftest.er1 >conftest.err
!   rm -f conftest.er1
!   cat conftest.err >&5
!   echo "$as_me:$LINENO: \$? = $ac_status" >&5
!   (exit $ac_status); } && {
! 	 test -z "$ac_c_werror_flag" ||
! 	 test ! -s conftest.err
!        } && test -s conftest$ac_exeext &&
!        $as_test_x conftest$ac_exeext; then
!   ac_cv_lib_pcre_pcre_exec=yes
  else
!   echo "$as_me: failed program was:" >&5
! sed 's/^/| /' conftest.$ac_ext >&5
  
- 	ac_cv_lib_pcre_pcre_exec=no
  fi
  
! rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
!       conftest$ac_exeext conftest.$ac_ext
! LIBS=$ac_check_lib_save_LIBS
  fi
! { echo "$as_me:$LINENO: result: $ac_cv_lib_pcre_pcre_exec" >&5
! echo "${ECHO_T}$ac_cv_lib_pcre_pcre_exec" >&6; }
! if test $ac_cv_lib_pcre_pcre_exec = yes; then
!   cat >>confdefs.h <<_ACEOF
! #define HAVE_LIBPCRE 1
! _ACEOF
  
!   LIBS="-lpcre $LIBS"
  
  fi
  
  fi
  
  ac_config_files="$ac_config_files Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile"
--- 10632,10867 ----
  
  # support for pcre
  if test x"$testpcre" = x"yes"; then
  
! 
! if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
! 	if test -n "$ac_tool_prefix"; then
!   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
! set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
! { echo "$as_me:$LINENO: checking for $ac_word" >&5
! echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
! if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
!   case $PKG_CONFIG in
!   [\\/]* | ?:[\\/]*)
!   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
!   ;;
!   *)
!   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
! for as_dir in $PATH
! do
!   IFS=$as_save_IFS
!   test -z "$as_dir" && as_dir=.
!   for ac_exec_ext in '' $ac_executable_extensions; do
!   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
!     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
!     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
!     break 2
!   fi
! done
! done
! IFS=$as_save_IFS
  
!   ;;
  esac
! fi
! PKG_CONFIG=$ac_cv_path_PKG_CONFIG
! if test -n "$PKG_CONFIG"; then
!   { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
! echo "${ECHO_T}$PKG_CONFIG" >&6; }
  else
!   { echo "$as_me:$LINENO: result: no" >&5
! echo "${ECHO_T}no" >&6; }
! fi
! 
  
  fi
+ if test -z "$ac_cv_path_PKG_CONFIG"; then
+   ac_pt_PKG_CONFIG=$PKG_CONFIG
+   # Extract the first word of "pkg-config", so it can be a program name with args.
+ set dummy pkg-config; ac_word=$2
+ { echo "$as_me:$LINENO: checking for $ac_word" >&5
+ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+ if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   case $ac_pt_PKG_CONFIG in
+   [\\/]* | ?:[\\/]*)
+   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+   ;;
+   *)
+   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+ do
+   IFS=$as_save_IFS
+   test -z "$as_dir" && as_dir=.
+   for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+ done
+ done
+ IFS=$as_save_IFS
  
!   ;;
! esac
  fi
! ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
! if test -n "$ac_pt_PKG_CONFIG"; then
!   { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
! echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
! else
!   { echo "$as_me:$LINENO: result: no" >&5
! echo "${ECHO_T}no" >&6; }
! fi
! 
!   if test "x$ac_pt_PKG_CONFIG" = x; then
!     PKG_CONFIG=""
!   else
!     case $cross_compiling:$ac_tool_warned in
! yes:)
! { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
! whose name does not start with the host triplet.  If you think this
! configuration is useful to you, please write to autoconf@gnu.org." >&5
! echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
! whose name does not start with the host triplet.  If you think this
! configuration is useful to you, please write to autoconf@gnu.org." >&2;}
! ac_tool_warned=yes ;;
! esac
!     PKG_CONFIG=$ac_pt_PKG_CONFIG
!   fi
! else
!   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
! fi
! 
! fi
! if test -n "$PKG_CONFIG"; then
! 	_pkg_min_version=0.9.0
! 	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
! echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
! 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
! 		{ echo "$as_me:$LINENO: result: yes" >&5
! echo "${ECHO_T}yes" >&6; }
! 	else
! 		{ echo "$as_me:$LINENO: result: no" >&5
! echo "${ECHO_T}no" >&6; }
! 		PKG_CONFIG=""
! 	fi
  
! fi
  
+ pkg_failed=no
+ { echo "$as_me:$LINENO: checking for pcre" >&5
+ echo $ECHO_N "checking for pcre... $ECHO_C" >&6; }
+ 
+ if test -n "$pcre_CFLAGS"; then
+     pkg_cv_pcre_CFLAGS="$pcre_CFLAGS"
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpcre\"") >&5
+   ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; then
+   pkg_cv_pcre_CFLAGS=`$PKG_CONFIG --cflags "libpcre" 2>/dev/null`
+ else
+   pkg_failed=yes
+ fi
+  else
+     pkg_failed=untried
+ fi
+ if test -n "$pcre_LIBS"; then
+     pkg_cv_pcre_LIBS="$pcre_LIBS"
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+     { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpcre\"") >&5
+   ($PKG_CONFIG --exists --print-errors "libpcre") 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; then
+   pkg_cv_pcre_LIBS=`$PKG_CONFIG --libs "libpcre" 2>/dev/null`
+ else
+   pkg_failed=yes
+ fi
+  else
+     pkg_failed=untried
  fi
  
+ 
+ 
+ if test $pkg_failed = yes; then
+ 
+ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+         _pkg_short_errors_supported=yes
+ else
+         _pkg_short_errors_supported=no
+ fi
+         if test $_pkg_short_errors_supported = yes; then
+ 	        pcre_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpcre" 2>&1`
+         else
+ 	        pcre_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpcre" 2>&1`
+         fi
+ 	# Put the nasty error message in config.log where it belongs
+ 	echo "$pcre_PKG_ERRORS" >&5
+ 
+ 	{ { echo "$as_me:$LINENO: error: Package requirements (libpcre) were not met:
+ 
+ $pcre_PKG_ERRORS
+ 
+ Consider adjusting the PKG_CONFIG_PATH environment variable if you
+ installed software in a non-standard prefix.
+ 
+ Alternatively, you may set the environment variables pcre_CFLAGS
+ and pcre_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.
+ " >&5
+ echo "$as_me: error: Package requirements (libpcre) were not met:
+ 
+ $pcre_PKG_ERRORS
+ 
+ Consider adjusting the PKG_CONFIG_PATH environment variable if you
+ installed software in a non-standard prefix.
+ 
+ Alternatively, you may set the environment variables pcre_CFLAGS
+ and pcre_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.
+ " >&2;}
+    { (exit 1); exit 1; }; }
+ elif test $pkg_failed = untried; then
+ 	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+ is in your PATH or set the PKG_CONFIG environment variable to the full
+ path to pkg-config.
+ 
+ Alternatively, you may set the environment variables pcre_CFLAGS
+ and pcre_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.
+ 
+ To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+ is in your PATH or set the PKG_CONFIG environment variable to the full
+ path to pkg-config.
+ 
+ Alternatively, you may set the environment variables pcre_CFLAGS
+ and pcre_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.
+ 
+ To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+ See \`config.log' for more details." >&2;}
+    { (exit 1); exit 1; }; }
+ else
+ 	pcre_CFLAGS=$pkg_cv_pcre_CFLAGS
+ 	pcre_LIBS=$pkg_cv_pcre_LIBS
+         { echo "$as_me:$LINENO: result: yes" >&5
+ echo "${ECHO_T}yes" >&6; }
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LIBPCRE 1
+ _ACEOF
+ 
  fi
  
  ac_config_files="$ac_config_files Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile"
***************
*** 10726,10737 ****
  # Ultrix sh set writes to stderr and can't be redirected directly,
  # and sets the high bit in the cache file unless we assign to the vars.
  (
!   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
      eval ac_val=\$$ac_var
      case $ac_val in #(
      *${as_nl}*)
        case $ac_var in #(
!       *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
  echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
        esac
        case $ac_var in #(
--- 10890,10902 ----
  # Ultrix sh set writes to stderr and can't be redirected directly,
  # and sets the high bit in the cache file unless we assign to the vars.
  (
!   for ac_var in `(set) 2>&1 | sed -n 's/^\(a-zA-Z_a-zA-Z0-9_*\)=.*/\1/p'`; do
      eval ac_val=\$$ac_var
      case $ac_val in #(
      *${as_nl}*)
        case $ac_var in #(
!       *_cv_*
! fi { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
  echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
        esac
        case $ac_var in #(
***************
*** 11514,11523 ****
  MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim
  INTL_LIBTOOL_SUFFIX_PREFIX!$INTL_LIBTOOL_SUFFIX_PREFIX$ac_delim
  SEP!$SEP$ac_delim
  LTLIBOBJS!$LTLIBOBJS$ac_delim
  _ACEOF
  
!   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then
      break
    elif $ac_last_try; then
      { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--- 11679,11691 ----
  MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim
  INTL_LIBTOOL_SUFFIX_PREFIX!$INTL_LIBTOOL_SUFFIX_PREFIX$ac_delim
  SEP!$SEP$ac_delim
+ PKG_CONFIG!$PKG_CONFIG$ac_delim
+ pcre_CFLAGS!$pcre_CFLAGS$ac_delim
+ pcre_LIBS!$pcre_LIBS$ac_delim
  LTLIBOBJS!$LTLIBOBJS$ac_delim
  _ACEOF
  
!   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then
      break
    elif $ac_last_try; then
      { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -rc -N grep-2.5.4.orig/configure.ac grep-2.5.4/configure.ac
*** grep-2.5.4.orig/configure.ac	2009-02-10 04:35:21.000000000 +0000
--- grep-2.5.4/configure.ac	2009-05-15 06:56:44.000000000 +0000
***************
*** 153,163 ****
  
  # support for pcre
  if test x"$testpcre" = x"yes"; then
! 	if pcre-config --cflags >/dev/null 2>&1; then
! 		CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
! 		LIBS="$LIBS `pcre-config --libs`"
! 	fi
! 	AC_CHECK_LIB(pcre, pcre_exec)
  fi
  
  AC_CONFIG_FILES([Makefile
--- 153,162 ----
  
  # support for pcre
  if test x"$testpcre" = x"yes"; then
! 	PKG_CHECK_MODULES(pcre, [libpcre],
! 	  AC_DEFINE(HAVE_LIBPCRE, 1,
! 	    [Define to 1 if you have the `pcre' library (-lpcre).]
! 	    CPPFLAGS="$CPPFLAGS $pcre_CFLAGS")
  fi
  
  AC_CONFIG_FILES([Makefile
diff -rc -N grep-2.5.4.orig/doc/Makefile.in grep-2.5.4/doc/Makefile.in
*** grep-2.5.4.orig/doc/Makefile.in	2009-02-10 04:35:27.000000000 +0000
--- grep-2.5.4/doc/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 63,72 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 63,73 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 156,161 ****
--- 157,163 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 206,211 ****
--- 208,215 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/lib/Makefile.in grep-2.5.4/lib/Makefile.in
*** grep-2.5.4.orig/lib/Makefile.in	2009-02-10 04:35:27.000000000 +0000
--- grep-2.5.4/lib/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 49,58 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 49,59 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 148,153 ****
--- 149,155 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 198,203 ****
--- 200,207 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/lib/posix/Makefile.in grep-2.5.4/lib/posix/Makefile.in
*** grep-2.5.4.orig/lib/posix/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/lib/posix/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 43,52 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 43,53 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 114,119 ****
--- 115,121 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 164,169 ****
--- 166,173 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/m4/Makefile.in grep-2.5.4/m4/Makefile.in
*** grep-2.5.4.orig/m4/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/m4/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 59,68 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 59,69 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 130,135 ****
--- 131,137 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 180,185 ****
--- 182,189 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/m4/pkg.m4 grep-2.5.4/m4/pkg.m4
*** grep-2.5.4.orig/m4/pkg.m4	1970-01-01 00:00:00.000000000 +0000
--- grep-2.5.4/m4/pkg.m4	2009-05-15 06:56:44.000000000 +0000
***************
*** 0 ****
--- 1,155 ----
+ # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+ # 
+ # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+ 
+ # PKG_PROG_PKG_CONFIG([MIN-VERSION])
+ # ----------------------------------
+ AC_DEFUN([PKG_PROG_PKG_CONFIG],
+ [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+ m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+ AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ 	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+ fi
+ if test -n "$PKG_CONFIG"; then
+ 	_pkg_min_version=m4_default([$1], [0.9.0])
+ 	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ 		AC_MSG_RESULT([yes])
+ 	else
+ 		AC_MSG_RESULT([no])
+ 		PKG_CONFIG=""
+ 	fi
+ 		
+ fi[]dnl
+ ])# PKG_PROG_PKG_CONFIG
+ 
+ # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+ #
+ # Check to see whether a particular set of modules exists.  Similar
+ # to PKG_CHECK_MODULES(), but does not set variables or print errors.
+ #
+ #
+ # Similar to PKG_CHECK_MODULES, make sure that the first instance of
+ # this or PKG_CHECK_MODULES is called, or make sure to call
+ # PKG_CHECK_EXISTS manually
+ # --------------------------------------------------------------
+ AC_DEFUN([PKG_CHECK_EXISTS],
+ [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+ if test -n "$PKG_CONFIG" && \
+     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+   m4_ifval([$2], [$2], [:])
+ m4_ifvaln([$3], [else
+   $3])dnl
+ fi])
+ 
+ 
+ # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+ # ---------------------------------------------
+ m4_define([_PKG_CONFIG],
+ [if test -n "$$1"; then
+     pkg_cv_[]$1="$$1"
+  elif test -n "$PKG_CONFIG"; then
+     PKG_CHECK_EXISTS([$3],
+                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ 		     [pkg_failed=yes])
+  else
+     pkg_failed=untried
+ fi[]dnl
+ ])# _PKG_CONFIG
+ 
+ # _PKG_SHORT_ERRORS_SUPPORTED
+ # -----------------------------
+ AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+ [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+         _pkg_short_errors_supported=yes
+ else
+         _pkg_short_errors_supported=no
+ fi[]dnl
+ ])# _PKG_SHORT_ERRORS_SUPPORTED
+ 
+ 
+ # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+ # [ACTION-IF-NOT-FOUND])
+ #
+ #
+ # Note that if there is a possibility the first call to
+ # PKG_CHECK_MODULES might not happen, you should be sure to include an
+ # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+ #
+ #
+ # --------------------------------------------------------------
+ AC_DEFUN([PKG_CHECK_MODULES],
+ [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+ AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+ 
+ pkg_failed=no
+ AC_MSG_CHECKING([for $1])
+ 
+ _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+ _PKG_CONFIG([$1][_LIBS], [libs], [$2])
+ 
+ m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+ and $1[]_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.])
+ 
+ if test $pkg_failed = yes; then
+         _PKG_SHORT_ERRORS_SUPPORTED
+         if test $_pkg_short_errors_supported = yes; then
+ 	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+         else 
+ 	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+         fi
+ 	# Put the nasty error message in config.log where it belongs
+ 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+ 
+ 	ifelse([$4], , [AC_MSG_ERROR(dnl
+ [Package requirements ($2) were not met:
+ 
+ $$1_PKG_ERRORS
+ 
+ Consider adjusting the PKG_CONFIG_PATH environment variable if you
+ installed software in a non-standard prefix.
+ 
+ _PKG_TEXT
+ ])],
+ 		[AC_MSG_RESULT([no])
+                 $4])
+ elif test $pkg_failed = untried; then
+ 	ifelse([$4], , [AC_MSG_FAILURE(dnl
+ [The pkg-config script could not be found or is too old.  Make sure it
+ is in your PATH or set the PKG_CONFIG environment variable to the full
+ path to pkg-config.
+ 
+ _PKG_TEXT
+ 
+ To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+ 		[$4])
+ else
+ 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ 	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+         AC_MSG_RESULT([yes])
+ 	ifelse([$3], , :, [$3])
+ fi[]dnl
+ ])# PKG_CHECK_MODULES
diff -rc -N grep-2.5.4.orig/src/Makefile.am grep-2.5.4/src/Makefile.am
*** grep-2.5.4.orig/src/Makefile.am	2009-01-31 05:39:54.000000000 +0000
--- grep-2.5.4/src/Makefile.am	2009-05-15 06:56:44.000000000 +0000
***************
*** 26,31 ****
--- 26,32 ----
  noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h mbsupport.h
  
  LDADD = @INTLLIBS@ ../lib/libgreputils.a
+ grep_LDADD = $(pcre_LIBS) $(LDADD)
  datadir = $(prefix)/@DATADIRNAME@
  localedir = $(datadir)/locale
  INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\"
diff -rc -N grep-2.5.4.orig/src/Makefile.in grep-2.5.4/src/Makefile.in
*** grep-2.5.4.orig/src/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/src/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 64,73 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 64,74 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 89,96 ****
  am_grep_OBJECTS = grep$U.$(OBJEXT) search$U.$(OBJEXT) \
  	kwset$U.$(OBJEXT) dfa$U.$(OBJEXT)
  grep_OBJECTS = $(am_grep_OBJECTS)
! grep_LDADD = $(LDADD)
! grep_DEPENDENCIES = ../lib/libgreputils.a
  DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
  depcomp = $(SHELL) $(top_srcdir)/depcomp
  am__depfiles_maybe = depfiles
--- 90,98 ----
  am_grep_OBJECTS = grep$U.$(OBJEXT) search$U.$(OBJEXT) \
  	kwset$U.$(OBJEXT) dfa$U.$(OBJEXT)
  grep_OBJECTS = $(am_grep_OBJECTS)
! am__DEPENDENCIES_1 =
! am__DEPENDENCIES_2 = ../lib/libgreputils.a
! grep_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
  DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
  depcomp = $(SHELL) $(top_srcdir)/depcomp
  am__depfiles_maybe = depfiles
***************
*** 161,166 ****
--- 163,169 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 211,216 ****
--- 214,221 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
***************
*** 229,234 ****
--- 234,240 ----
  fgrep_SOURCES = fgrep.c fsearch.c kwset.c
  noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h mbsupport.h
  LDADD = @INTLLIBS@ ../lib/libgreputils.a
+ grep_LDADD = $(pcre_LIBS) $(LDADD)
  INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\"
  EXTRA_DIST = \
               dosbuf.c \
diff -rc -N grep-2.5.4.orig/tests/Makefile.in grep-2.5.4/tests/Makefile.in
*** grep-2.5.4.orig/tests/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/tests/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 59,68 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 59,69 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 128,133 ****
--- 129,135 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 178,183 ****
--- 180,187 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
diff -rc -N grep-2.5.4.orig/vms/Makefile.in grep-2.5.4/vms/Makefile.in
*** grep-2.5.4.orig/vms/Makefile.in	2009-02-10 04:35:28.000000000 +0000
--- grep-2.5.4/vms/Makefile.in	2009-05-15 06:56:44.000000000 +0000
***************
*** 43,52 ****
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/realloc.m4 \
! 	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/sanity.m4 \
! 	$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \
! 	$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
--- 43,53 ----
  	$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/largefile.m4 \
  	$(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/malloc.m4 \
  	$(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/missing.m4 \
! 	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
! 	$(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
! 	$(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/uintmax_t.m4 \
! 	$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/xstrtoumax.m4 \
! 	$(top_srcdir)/configure.ac
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  	$(ACLOCAL_M4)
  mkinstalldirs = $(install_sh) -d
***************
*** 114,119 ****
--- 115,121 ----
  PACKAGE_TARNAME = @PACKAGE_TARNAME@
  PACKAGE_VERSION = @PACKAGE_VERSION@
  PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
  POFILES = @POFILES@
  POSUB = @POSUB@
  RANLIB = @RANLIB@
***************
*** 164,169 ****
--- 166,173 ----
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
+ pcre_CFLAGS = @pcre_CFLAGS@
+ pcre_LIBS = @pcre_LIBS@
  pdfdir = @pdfdir@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
