aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/zsh/files/pcre-pkgconfig.patch
blob: ebbd03f071bf9b5397c90c5904e888ca0b71ba5d (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
44
45
46
47
48
49
diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd
index 6eb3c691b..12c10704e 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/configure.ac b/configure.ac
index 920c2fc17..d1512291c 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 ---------------------