summaryrefslogtreecommitdiff
blob: 29a6a5483bb891c9f4d478e52b2a816a46f92151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 configure.ac | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0bfca01..2d8ec3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,19 +183,23 @@ AC_CHECK_FUNCS(strcasecmp)
 
 if test x$(uname) != xDarwin;
 then 
-AC_CHECK_HEADER(pcreposix.h,
-  AC_CHECK_LIB(pcre, pcre_info,[
-  LIBS="$LIBS -lpcreposix -lpcre"
-  no_comp_check=yes],
-  AC_MSG_ERROR([*** unable to locate pcre library ***])),
-  AC_MSG_ERROR([*** unable to locate pcreposix.h include file ***]))
+PKG_CHECK_MODULES([PCRE],
+  [libpcre libpcreposix libpcrecpp],
+  [LIBS="${LIBS} ${PCRE_LIBS}" no_comp_check=yes], [
+    AC_CHECK_HEADER(pcreposix.h,
+      AC_CHECK_LIB(pcre, pcre_version,[
+      LIBS="$LIBS -lpcreposix -lpcre"
+      no_comp_check=yes],
+      AC_MSG_ERROR([*** unable to locate pcre library ***])),
+      AC_MSG_ERROR([*** unable to locate pcreposix.h include file ***]))
 
-AC_CHECK_HEADER(pcrecpp.h,
-  AC_CHECK_LIB(pcrecpp,pcre_compile,[
-  LIBS="$LIBS -lpcrecpp"
-  no_comp_check=yes],
-  AC_MSG_ERROR([*** unable to locate pcrecpp library ***])),
-  AC_MSG_ERROR([*** unable to locate pcrecpp.h include file ***])) 
+    AC_CHECK_HEADER(pcrecpp.h,
+      AC_CHECK_LIB(pcrecpp,pcre_compile,[
+      LIBS="$LIBS -lpcrecpp"
+      no_comp_check=yes],
+      AC_MSG_ERROR([*** unable to locate pcrecpp library ***])),
+      AC_MSG_ERROR([*** unable to locate pcrecpp.h include file ***])) 
+  ])
 fi