Skip to content

Commit 5e81cf6

Browse files
committed
ext/pcre: simplify pkg-config routine to use standard macro
logic is still entwined with bundling code
1 parent 941a1da commit 5e81cf6

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

ext/pcre/config0.m4

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,10 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality
1111

1212
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
1313

14+
# FIXME: don't define "I'm not bundled" as only versions installed in /usr
1415
if test "$PHP_PCRE_REGEX" = "/usr"; then
15-
if test -z "$PKG_CONFIG"; then
16-
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
17-
fi
18-
if test -x "$PKG_CONFIG"; then
19-
AC_MSG_CHECKING(for PCRE2 10.30 or greater)
20-
if $PKG_CONFIG --atleast-version 10.30 libpcre2-8; then
21-
PCRE2_VER=`$PKG_CONFIG --modversion libpcre2-8`
22-
AC_MSG_RESULT($PCRE2_VER)
23-
else
24-
AC_MSG_ERROR(PCRE2 version 10.30 or later is required to compile php with PCRE2 support)
25-
fi
26-
PCRE2_LIB=`$PKG_CONFIG --libs libpcre2-8`
27-
PCRE2_INC=`$PKG_CONFIG --cflags libpcre2-8`
28-
fi
16+
PKG_CHECK_MODULES([PCRE2], [libpcre2-8 >= 10.30], ,
17+
AC_MSG_ERROR(PCRE2 version 10.30 or later is required to compile php with PCRE2 support))
2918
fi
3019

3120
dnl PCRE2 in a non standard prefix should still have its config tool.
@@ -41,13 +30,13 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality
4130
AC_MSG_RESULT($PCRE2_VER)
4231
fi
4332
PCRE2_LIB=`$PCRE2_CONF --libs8`
44-
PCRE2_INC=`$PCRE2_CONF --cflags`
33+
PCRE2_CFLAGS=`$PCRE2_CONF --cflags`
4534
else
4635
AC_MSG_ERROR(Couldn't find pcre2-config)
4736
fi
4837
fi
4938

50-
PHP_EVAL_INCLINE($PCRE2_INC)
39+
PHP_EVAL_INCLINE($PCRE2_CFLAGS)
5140
PHP_EVAL_LIBLINE($PCRE2_LIB)
5241
AC_DEFINE(PCRE2_CODE_UNIT_WIDTH, 8, [ ])
5342
AC_DEFINE(HAVE_PCRE, 1, [ ])

0 commit comments

Comments
 (0)