Skip to content

[TEMP][DRAFT] Re-bundle oniguruma #19258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ PHP 8.5 UPGRADE NOTES
return SQL_NO_TOTAL in SQLGetData are also better handled as well.
This should improve compatibility and performance. See GH-10809, GH-10733.

- MBstring
. Oniguruma maintenance was end at 2025-04-25. So re-bundle Oniguruma.
This changes temporary, mbregex functions should be removed soon.

========================================
14. Performance Improvements
========================================
Expand Down
76 changes: 73 additions & 3 deletions ext/mbstring/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,79 @@ AC_DEFUN([PHP_MBSTRING_ADD_CFLAG], [
])

AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
PKG_CHECK_MODULES([ONIG], [oniguruma])
PHP_EVAL_LIBLINE([$ONIG_LIBS], [MBSTRING_SHARED_LIBADD])
PHP_EVAL_INCLINE([$ONIG_CFLAGS])
PHP_MBSTRING_BUNDLED_ONIG=1

if test "$PHP_MBSTRING_BUNDLED_ONIG" = "1"; then
cp $ext_srcdir/oniguruma/src/oniguruma.h $ext_srcdir/oniguruma/oniguruma.h
fi

AC_CHECK_HEADERS([strings.h unistd.h sys/time.h sys/times.h limits.h])
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(long, 4)
AC_FUNC_ALLOCA
AC_CHECK_HEADER([stdarg.h], [
AC_DEFINE([HAVE_STDARG_PROTOTYPES], [1], [Define to 1 if you have the <stdarg.h> header file.])
], [])
AC_DEFINE([PHP_ONIG_BUNDLED], [1], [Define to 1 if the bundled oniguruma is used])
AC_DEFINE([HAVE_ONIG], [1], [Define to 1 if the oniguruma library is available])
PHP_MBSTRING_ADD_CFLAG([-DNOT_RUBY])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/src])
PHP_MBSTRING_ADD_INCLUDE([oniguruma])
PHP_MBSTRING_ADD_SOURCES([
oniguruma/src/ascii.c
oniguruma/src/big5.c
oniguruma/src/cp1251.c
oniguruma/src/euc_jp.c
oniguruma/src/euc_jp_prop.c
oniguruma/src/euc_kr.c
oniguruma/src/euc_tw.c
oniguruma/src/gb18030.c
oniguruma/src/iso8859_1.c
oniguruma/src/iso8859_10.c
oniguruma/src/iso8859_11.c
oniguruma/src/iso8859_13.c
oniguruma/src/iso8859_14.c
oniguruma/src/iso8859_15.c
oniguruma/src/iso8859_16.c
oniguruma/src/iso8859_2.c
oniguruma/src/iso8859_3.c
oniguruma/src/iso8859_4.c
oniguruma/src/iso8859_5.c
oniguruma/src/iso8859_6.c
oniguruma/src/iso8859_7.c
oniguruma/src/iso8859_8.c
oniguruma/src/iso8859_9.c
oniguruma/src/koi8.c
oniguruma/src/koi8_r.c
oniguruma/src/onig_init.c
oniguruma/src/regcomp.c
oniguruma/src/regenc.c
oniguruma/src/regerror.c
oniguruma/src/regexec.c
oniguruma/src/regext.c
oniguruma/src/reggnu.c
oniguruma/src/regparse.c
oniguruma/src/regposerr.c
oniguruma/src/regposix.c
oniguruma/src/regsyntax.c
oniguruma/src/regtrav.c
oniguruma/src/regversion.c
oniguruma/src/sjis.c
oniguruma/src/sjis_prop.c
oniguruma/src/st.c
oniguruma/src/unicode.c
oniguruma/src/unicode_fold1_key.c
oniguruma/src/unicode_fold2_key.c
oniguruma/src/unicode_fold3_key.c
oniguruma/src/unicode_unfold_key.c
oniguruma/src/utf16_be.c
oniguruma/src/utf16_le.c
oniguruma/src/utf32_be.c
oniguruma/src/utf32_le.c
oniguruma/src/utf8.c
])

AC_CACHE_CHECK([if oniguruma has an invalid entry for KOI8 encoding],
[php_cv_lib_onig_invalid_koi8],
Expand Down
5 changes: 4 additions & 1 deletion ext/mbstring/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ if (PHP_MBSTRING != "no") {
EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED);
ADD_EXTENSION_DEP('mbstring', 'pcre');

FSO.CopyFile("ext\\mbstring\\oniguruma\\src\\oniguruma.h",
"ext\\mbstring\\oniguruma\\oniguruma.h", true);

STDOUT.WriteLine("Using bundled libmbfl...");

ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring -Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring -Iext/mbstring/libmbfl -Iext/mbstring/oniguruma -Iext/mbstring/libmbfl/mbfl \
/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")

ADD_FLAG("CFLAGS_BD_EXT_MBSTRING", "/utf-8")
Expand Down
1 change: 1 addition & 0 deletions ext/mbstring/oniguruma/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<[email protected]> (K.Kosako)
26 changes: 26 additions & 0 deletions ext/mbstring/oniguruma/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Oniguruma LICENSE
-----------------

Copyright (c) 2002-2021 K.Kosako <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Empty file.
Loading
Loading