Skip to content

Commit 4659bc2

Browse files
committed
ext/intl: fix clang build.
actually, with recent icu releases, this problem arises ``` checking whether clang++ supports C++17 features with -std=c++17... no checking whether clang++ supports C++17 features with +std=c++17... no checking whether clang++ supports C++17 features with -h std=c++17... no checking whether clang++ supports C++17 features with -std=c++1z... no checking whether clang++ supports C++17 features with +std=c++1z... no checking whether clang++ supports C++17 features with -h std=c++1z... no configure: error: *** A compiler with support for C++17 language features is required. ``` thus, proposing to falls into LLVM libc++ instead.
1 parent e7a44a6 commit 4659bc2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build/php.m4

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,14 @@ AC_DEFUN([PHP_REQUIRE_CXX],[
742742
if test -z "$php_cxx_done"; then
743743
AC_PROG_CXX
744744
AC_PROG_CXXCPP
745-
PHP_ADD_LIBRARY(stdc++)
745+
case "$CXX" in
746+
*clang++*)
747+
PHP_ADD_LIBRARY(c++)
748+
;;
749+
*)
750+
PHP_ADD_LIBRARY(stdc++)
751+
;;
752+
esac
746753
php_cxx_done=yes
747754
fi
748755
])

build/php_cxx_compile_stdcxx.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ AC_DEFUN([PHP_CXX_COMPILE_STDCXX], [dnl
4040
dnl Cray's crayCC needs "-h std=c++11"
4141
for alternative in ${ax_cxx_compile_alternatives}; do
4242
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
43+
case "$CXX" in
44+
*clang++*)
45+
switch="${switch} -stdlib=libc++"
46+
;;
47+
esac
4348
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
4449
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
4550
$cachevar,

0 commit comments

Comments
 (0)