diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-07-19 19:27:23 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-07-19 19:30:41 +0200 |
commit | 504cd03fc33844eaadc3de1117c220ad7612b784 (patch) | |
tree | aa199b43179bbd61a8ff74da5682ef440fdbff72 | |
parent | aa2e2c3f93e6d8e6388bbcfa5a986efb155e9411 (diff) | |
download | php-git-504cd03fc33844eaadc3de1117c220ad7612b784.tar.gz |
Move Oniguruma related config stuff to where it belongs
Oniguruma is exclusively used by ext/mbstring, and only if mbregex is
enabled. Therefore it is unnecessary and confusing to have Oniguruma
related config stuff scattered elsewhere.
While we're at it, we also remove the referral to the bundled libonig
which is removed as of PHP 7.4.0, and the duplicated call to
`PHP_INSTALL_HEADERS()`.
-rw-r--r-- | ext/mbstring/config.w32 | 23 | ||||
-rw-r--r-- | ext/standard/config.w32 | 4 |
2 files changed, 14 insertions, 13 deletions
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32 index b86c9fdae2..ff1a20f2a3 100644 --- a/ext/mbstring/config.w32 +++ b/ext/mbstring/config.w32 @@ -5,13 +5,9 @@ ARG_ENABLE("mbregex", "multibyte regex support", "no"); if (PHP_MBSTRING != "no") { - if (CHECK_LIB("onig_a.lib;libonig_a.lib", "mbstring", PHP_MBSTRING) && - CHECK_HEADER_ADD_INCLUDE("mbstring.h", "CFLAGS_MBSTRING", PHP_MBSTRING + ";" + PHP_PHP_BUILD + "\\include")) { + if (CHECK_HEADER_ADD_INCLUDE("mbstring.h", "CFLAGS_MBSTRING", PHP_MBSTRING + ";" + PHP_PHP_BUILD + "\\include")) { EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED); - /* XXX libonig is only usable as a static library ATM, code change required to link with a DLL. */ - ADD_FLAG("CFLAGS_MBSTRING", "/DONIG_EXTERN=extern /DPHP_ONIG_BAD_KOI8_ENTRY=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); - STDOUT.WriteLine("Using bundled libmbfl..."); ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \ @@ -52,14 +48,23 @@ if (PHP_MBSTRING != "no") { nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \ nls_ua.c nls_tr.c", "mbstring"); - PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h"); + PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h"); AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support'); if (PHP_MBREGEX != "no") { - AC_DEFINE('HAVE_MBREGEX', 1); - ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring"); - PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h"); + if (CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX) && + CHECK_LIB("onig_a.lib;libonig_a.lib", "mbstring", PHP_MBSTRING)) { + AC_DEFINE('HAVE_MBREGEX', 1); + + /* XXX libonig is only usable as a static library ATM, code change required to link with a DLL. */ + ADD_FLAG("CFLAGS_MBSTRING", "/DONIG_EXTERN=extern /DPHP_ONIG_BAD_KOI8_ENTRY=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + + ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring"); + PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h php_onig_compat.h"); + } else { + WARNING("mbregex not enabled; libraries and headers not found"); + } } } else { diff --git a/ext/standard/config.w32 b/ext/standard/config.w32 index d1c9233016..0f47242145 100644 --- a/ext/standard/config.w32 +++ b/ext/standard/config.w32 @@ -37,9 +37,5 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \ user_filters.c uuencode.c filters.c proc_open.c password.c \ streamsfuncs.c http.c flock_compat.c random.c hrtime.c", false /* never shared */, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); - PHP_INSTALL_HEADERS("", "ext/standard"); -if (PHP_MBREGEX != "no") { - CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma") -} ADD_MAKEFILE_FRAGMENT(); PHP_INSTALL_HEADERS("", "ext/standard"); |