Skip to content

Commit

Permalink
Autotools: Normalize pcre sources (#15085)
Browse files Browse the repository at this point in the history
  • Loading branch information
petk authored Jul 23, 2024
1 parent 6cdff75 commit 40cf2e1
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions ext/pcre/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,44 @@ if test "$PHP_EXTERNAL_PCRE" != "no"; then
[AC_DEFINE([HAVE_PCRE_JIT_SUPPORT], [1])])
])

PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_NEW_EXTENSION([pcre],
[php_pcre.c],
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
else
AC_MSG_CHECKING([for PCRE library to use])
AC_MSG_RESULT([bundled])
pcrelib_sources="pcre2lib/pcre2_auto_possess.c pcre2lib/pcre2_chartables.c pcre2lib/pcre2_compile.c \
pcre2lib/pcre2_config.c pcre2lib/pcre2_context.c pcre2lib/pcre2_chkdint.c pcre2lib/pcre2_dfa_match.c pcre2lib/pcre2_error.c \
pcre2lib/pcre2_jit_compile.c pcre2lib/pcre2_maketables.c pcre2lib/pcre2_match.c pcre2lib/pcre2_match_data.c \
pcre2lib/pcre2_newline.c pcre2lib/pcre2_ord2utf.c pcre2lib/pcre2_pattern_info.c pcre2lib/pcre2_serialize.c \
pcre2lib/pcre2_string_utils.c pcre2lib/pcre2_study.c pcre2lib/pcre2_substitute.c pcre2lib/pcre2_substring.c \
pcre2lib/pcre2_tables.c pcre2lib/pcre2_ucd.c pcre2lib/pcre2_valid_utf.c pcre2lib/pcre2_xclass.c \
pcre2lib/pcre2_find_bracket.c pcre2lib/pcre2_convert.c pcre2lib/pcre2_extuni.c pcre2lib/pcre2_script_run.c"
pcrelib_sources=m4_normalize(["
pcre2lib/pcre2_auto_possess.c
pcre2lib/pcre2_chartables.c
pcre2lib/pcre2_chkdint.c
pcre2lib/pcre2_compile.c
pcre2lib/pcre2_config.c
pcre2lib/pcre2_context.c
pcre2lib/pcre2_convert.c
pcre2lib/pcre2_dfa_match.c
pcre2lib/pcre2_error.c
pcre2lib/pcre2_extuni.c
pcre2lib/pcre2_find_bracket.c
pcre2lib/pcre2_jit_compile.c
pcre2lib/pcre2_maketables.c
pcre2lib/pcre2_match_data.c
pcre2lib/pcre2_match.c
pcre2lib/pcre2_newline.c
pcre2lib/pcre2_ord2utf.c
pcre2lib/pcre2_pattern_info.c
pcre2lib/pcre2_script_run.c
pcre2lib/pcre2_serialize.c
pcre2lib/pcre2_string_utils.c
pcre2lib/pcre2_study.c
pcre2lib/pcre2_substitute.c
pcre2lib/pcre2_substring.c
pcre2lib/pcre2_tables.c
pcre2lib/pcre2_ucd.c
pcre2lib/pcre2_valid_utf.c
pcre2lib/pcre2_xclass.c
"])

AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
[PHP_PCRE_CFLAGS="$PHP_PCRE_CFLAGS -Wno-implicit-fallthrough"],,
Expand Down Expand Up @@ -88,7 +114,10 @@ else
[AC_DEFINE([HAVE_PCRE_VALGRIND_SUPPORT], [1],
[Define to 1 if pcre has Valgrind support enabled.])])])

PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
PHP_NEW_EXTENSION([pcre],
[$pcrelib_sources php_pcre.c],
[no],,
[$PHP_PCRE_CFLAGS])
PHP_ADD_BUILD_DIR([$ext_builddir/pcre2lib])
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcre2lib/])
fi

0 comments on commit 40cf2e1

Please sign in to comment.