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 ---------------------