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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd
index 6eb3c69..12c1070 100644
--- a/Src/Modules/pcre.mdd
+++ b/Src/Modules/pcre.mdd
@@ -1,5 +1,5 @@
name=zsh/pcre
-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi`
+link=`if test x$enable_pcre = xyes ; then echo dynamic; else echo no; fi`
load=no
autofeatures="b:pcre_compile b:pcre_study b:pcre_match"
diff --git a/aclocal.m4 b/aclocal.m4
index e91be3c..5580d13 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -75,3 +75,4 @@ AC_SUBST(LN)dnl
])
builtin(include, aczsh.m4)
+builtin(include, pkg.m4)
diff --git a/configure.ac b/configure.ac
index 920c2fc..d151229 100644
--- a/configure.ac
+++ b/configure.ac
@@ -671,17 +671,15 @@ AC_HEADER_TIME
AC_HEADER_STAT
AC_HEADER_SYS_WAIT
-oldcflags="$CFLAGS"
if test x$enable_pcre = xyes; then
-AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config)
-dnl Typically (meaning on this single RedHat 9 box in front of me)
-dnl pcre-config --cflags produces a -I output which needs to go into
-dnl CPPFLAGS else configure's preprocessor tests don't pick it up,
-dnl producing a warning.
-if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then
- CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
-fi
+PKG_CHECK_MODULES(PCREPKG, [libpcre], [
+ PCRE_LIB="${PCREPKG_LIBS}"
+ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
+ ], [
+ AC_MSG_ERROR([pcre not found, install the pcre-devel package or build with --disable-pcre])
+ ])
fi
+oldcflags="$CFLAGS"
AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
termios.h sys/param.h sys/filio.h string.h memory.h \
@@ -935,7 +933,7 @@ fi
if test x$enable_pcre = xyes; then
dnl pcre-config should probably be employed here
dnl AC_SEARCH_LIBS(pcre_compile, pcre)
- LIBS="`$ac_cv_prog_PCRECONF --libs` $LIBS"
+ LIBS="$PCRE_LIB $LIBS"
fi
dnl ---------------------
|