summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-12-04 12:49:47 +0100
committerPaolo Bonzini <bonzini@gnu.org>2009-12-04 12:53:07 +0100
commit453effe8f29f3159bb374e2d4c65cfae3ff3cd18 (patch)
tree9a74a85f8e23deaf3dbf7cb1fe85141b45397034 /configure.ac
parent4f67550194ca691d9ae2196a030472d80bf73f52 (diff)
downloadgrep-453effe8f29f3159bb374e2d4c65cfae3ff3cd18.tar.gz
switch to pkg-config for PCRE detection
* configure.ac: use pkg-config to detect PCRE * src/Makefile.am (grep_LDADD): link grep with PCRE_LIBS
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 14b0e9f1..4a25962f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,12 +88,13 @@ if test "$jm_with_regex" = no; then
fi
# support for pcre
+PKG_PROG_PKG_CONFIG
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)
+ 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