Skip to content

Fix check for newer versions of ICU #14186

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

Merged
merged 2 commits into from
May 10, 2024

Conversation

NattyNarwhal
Copy link
Member

The previous test would always trigger, even if the version of ICU installed didn't require C++17. This was because it incorrectly used the test program, which broke the build on systems without a C++17 compiler.

Tested with macOS 14 and i 7.2. Targeting 8.2 for fixing the regression introduced into there.

The previous test would always trigger, even if the version of ICU
installed didn't require C++17. This was because it incorrectly used
the `test` program, which broke the build on systems without a C++17
compiler.

Tested with macOS 14 and i 7.2.
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let @petk have a look perhaps too ?

@petk
Copy link
Member

petk commented May 9, 2024

Yes, this now works properly indeed - without that test in there. Thanks for finding it and fixing it.

There is one more to change in the php.m4. It appended this definition anyway regardless of version and since the symbol got introduced in v60, no problem if now works correctly there. This can go to PHP-8.2 also:

--- a/build/php.m4
+++ b/build/php.m4
@@ -1819,9 +1819,8 @@ AC_DEFUN([PHP_SETUP_ICU],[
   ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
   ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
 
-  if test "$PKG_CONFIG icu-io --atleast-version=60"; then
-    ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
-  fi
+  AS_IF([$PKG_CONFIG icu-io --atleast-version=60],
+    [ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"])
 ])

Same as the previous fix for C++17.
@NattyNarwhal NattyNarwhal merged commit 4e21a26 into php:PHP-8.2 May 10, 2024
8 checks passed
@harfinch
Copy link

The changes to ext/intl/config.m4 and build/php.m4 are not enough for me. I still have to change the configure script as well.

--- configure.orig      2024-05-10 13:45:38.311436752 -0600
+++ configure   2024-05-10 13:45:53.832945544 -0600
@@ -48868,7 +48868,7 @@
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if intl requires -std=gnu++17" >&5
 printf %s "checking if intl requires -std=gnu++17... " >&6; }
 
-if test "$PKG_CONFIG icu-uc --atleast-version=74"
+if $PKG_CONFIG icu-uc --atleast-version=74
 then :
 
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5

Is this supposed to be necessary?

@devnexen
Copy link
Member

Did you build from the github repo ? Did you do buildconf -f before ./configure ?

@NattyNarwhal
Copy link
Member Author

What David said. The configure script is built from these files. Once you change those files, you'll need to regenerate the build system with ./buildconf -f (-f needed because you're rebuilding the files from the release tarball as opposed to from git).

@harfinch
Copy link

Did you build from the github repo ? Did you do buildconf -f before ./configure ?

That was the missing step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants