diff options
author | Anatol Belski <ab@php.net> | 2018-09-28 16:46:47 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-10-07 20:00:03 +0200 |
commit | 4acc8500acd134dfab1a2ddb83aeb39fa1033abe (patch) | |
tree | 005c2820a874222c40bbca640b09d6e8166e294e /ext/intl | |
parent | dcdf1ccf685a486c8073cedb7533302a4171bea1 (diff) | |
download | php-git-4acc8500acd134dfab1a2ddb83aeb39fa1033abe.tar.gz |
Enforce C++11 in ext/intl
ICU 59 already requires C++11 by default. The minimum version required
by the core is 50, which is compiled with at least C++11 in many distros
as package defs tell. Headers for ICU versions between ICU 50 and 58 look
fine when included for C++11 compilation, the linking is thereof not affected.
The macro PHP_CXX_COMPILE_STDCXX is based on
https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
The patch consists on allowing to read the corresponding switch in a user
defined variable instead of enforcing CXXFLAGS globally. That way, every
ext or SAPI can decide, which C++ standard is to be used. The
documentation is provided in the m4 file.
C++11 is already somewhat older standard, C++14 were better. However
issues with GCC < 5.0 and some other compilers are possibly to hit back.
Still there's some time to check for C++14 for ext/intl, too. Having said
that, C++11 in ext/intl and a mechanism to determine features is a good step
towards better C++ support.
Diffstat (limited to 'ext/intl')
-rw-r--r-- | ext/intl/config.m4 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index a9f9b39cb0..a80391bb58 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -8,7 +8,6 @@ PHP_ARG_ENABLE(intl, whether to enable internationalization support, if test "$PHP_INTL" != "no"; then PHP_SETUP_ICU(INTL_SHARED_LIBADD) PHP_SUBST(INTL_SHARED_LIBADD) - PHP_REQUIRE_CXX() INTL_COMMON_FLAGS="$ICU_INCS $ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" PHP_NEW_EXTENSION(intl, php_intl.c \ intl_error.c \ @@ -84,7 +83,10 @@ if test "$PHP_INTL" != "no"; then breakiterator/rulebasedbreakiterator_methods.cpp \ breakiterator/codepointiterator_internal.cpp \ breakiterator/codepointiterator_methods.cpp" - PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS" + + PHP_REQUIRE_CXX() + PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX) + PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS" if test "$ext_shared" = "no"; then PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS) else |