@@ -14,66 +14,67 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality
14
14
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
15
15
AC_MSG_CHECKING ( [ for PCRE headers location] )
16
16
for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
17
- test -f $i/pcre .h && PCRE_INCDIR=$i
17
+ test -f $i/pcre2 .h && PCRE_INCDIR=$i
18
18
done
19
19
20
20
if test -z "$PCRE_INCDIR"; then
21
- AC_MSG_ERROR ( [ Could not find pcre .h in $PHP_PCRE_REGEX] )
21
+ AC_MSG_ERROR ( [ Could not find pcre2 .h in $PHP_PCRE_REGEX] )
22
22
fi
23
23
AC_MSG_RESULT ( [ $PCRE_INCDIR] )
24
24
25
25
AC_MSG_CHECKING ( [ for PCRE library location] )
26
26
for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
27
- test -f $j/libpcre .a || test -f $j/libpcre .$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
27
+ test -f $j/libpcre2 .a || test -f $j/libpcre2 .$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
28
28
done
29
29
30
30
if test -z "$PCRE_LIBDIR" ; then
31
- AC_MSG_ERROR ( [ Could not find libpcre .(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX] )
31
+ AC_MSG_ERROR ( [ Could not find libpcre2 .(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX] )
32
32
fi
33
33
AC_MSG_RESULT ( [ $PCRE_LIBDIR] )
34
34
35
35
changequote ( { ,} )
36
- pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre .h | sed -e 's/[ ^0-9] //g'`
37
- pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre .h | sed -e 's/[ ^0-9] //g'`
36
+ pcre_major=`grep PCRE2_MAJOR $PCRE_INCDIR/pcre2 .h | sed -e 's/[ ^0-9] //g'`
37
+ pcre_minor=`grep PCRE2_MINOR $PCRE_INCDIR/pcre2 .h | sed -e 's/[ ^0-9] //g'`
38
38
changequote ( [ ,] )
39
39
pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[ ^0-9] //g'`
40
40
if test "$pcre_minor_length" -eq 2 ; then
41
41
pcre_minor="$pcre_minor"0
42
42
fi
43
43
pcre_version=$pcre_major$pcre_minor
44
- if test "$pcre_version" -lt 660 ; then
45
- AC_MSG_ERROR ( [ The PCRE extension requires PCRE library version >= 6.6 ] )
44
+ if test "$pcre_version" -lt 1030 ; then
45
+ AC_MSG_ERROR ( [ The PCRE extension requires PCRE library version >= 10.30 ] )
46
46
fi
47
47
48
- PHP_CHECK_LIBRARY(pcre, pcre_jit_exec ,
48
+ PHP_CHECK_LIBRARY(pcre2, pcre2_jit_exec ,
49
49
[
50
50
AC_DEFINE ( HAVE_PCRE_JIT_SUPPORT , 1 , [ ] )
51
51
] ,[
52
52
] ,[
53
53
-L$PCRE_LIBDIR
54
54
] )
55
- PHP_ADD_LIBRARY_WITH_PATH(pcre , $PCRE_LIBDIR)
55
+ PHP_ADD_LIBRARY_WITH_PATH(pcre2 , $PCRE_LIBDIR)
56
56
57
57
AC_DEFINE ( HAVE_PCRE , 1 , [ ] )
58
+ AC_DEFINE ( PCRE2_CODE_UNIT_WIDTH , 8 , [ ] )
58
59
PHP_ADD_INCLUDE($PCRE_INCDIR)
59
60
PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
60
61
PHP_INSTALL_HEADERS([ ext/pcre] , [ php_pcre.h] )
61
62
else
62
63
AC_MSG_CHECKING ( [ for PCRE library to use] )
63
64
AC_MSG_RESULT ( [ bundled] )
64
- pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucd.c \
65
- pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c \
66
- pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c \
67
- pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \
68
- pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c \
69
- pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \
70
- pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
71
- pcrelib/pcre_jit_compile.c"
72
- PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
65
+ pcrelib_sources="pcre2lib/pcre2_auto_possess.c pcre2lib/pcre2_chartables.c pcre2lib/pcre2_compile.c \
66
+ pcre2lib/pcre2_config.c pcre2lib/pcre2_context.c pcre2lib/pcre2_dfa_match.c pcre2lib/pcre2_error.c \
67
+ pcre2lib/pcre2_jit_compile.c pcre2lib/pcre2_maketables.c pcre2lib/pcre2_match.c pcre2lib/pcre2_match_data.c \
68
+ pcre2lib/pcre2_newline.c pcre2lib/pcre2_ord2utf.c pcre2lib/pcre2_pattern_info.c pcre2lib/pcre2_serialize.c \
69
+ pcre2lib/pcre2_string_utils.c pcre2lib/pcre2_study.c pcre2lib/pcre2_substitute.c pcre2lib/pcre2_substring.c \
70
+ pcre2lib/pcre2_tables.c pcre2lib/pcre2_ucd.c pcre2lib/pcre2_valid_utf.c pcre2lib/pcre2_xclass.c \
71
+ pcre2lib/pcre2_find_bracket.c pcre2lib/pcre2_convert.c"
72
+ PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
73
73
PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
74
- PHP_ADD_BUILD_DIR($ext_builddir/pcrelib )
75
- PHP_INSTALL_HEADERS([ ext/pcre] , [ php_pcre.h pcrelib /] )
74
+ PHP_ADD_BUILD_DIR($ext_builddir/pcre2lib )
75
+ PHP_INSTALL_HEADERS([ ext/pcre] , [ php_pcre.h pcre2lib /] )
76
76
AC_DEFINE ( HAVE_BUNDLED_PCRE , 1 , [ ] )
77
+ AC_DEFINE ( PCRE2_CODE_UNIT_WIDTH , 8 , [ ] )
77
78
78
79
if test "$PHP_PCRE_REGEX" != "no"; then
79
80
AC_MSG_CHECKING ( [ whether to enable PCRE JIT functionality] )
0 commit comments