php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #77241
Patch Use-pkg-config-to-detect-icu revision 2018-12-05 11:29 UTC by hugh dot mcmaster at outlook dot com
revision 2018-12-05 10:39 UTC by hugh dot mcmaster at outlook dot com

Patch Use-pkg-config-to-detect-icu for *Compile Issues Bug #77241

Patch version 2018-12-05 11:29 UTC

Return to Bug #77241 | Download this patch
Patch Revisions: 2018-12-05 11:29 UTC | 2018-12-05 10:39 UTC

Developer: hugh.mcmaster@outlook.com


 From e2b117dbc264360da76ba0d1653741c13ae43339 Mon Sep 17 00:00:00 2001
 From 137318ad88801756535bfcc664e14b382fc9a4ac Mon Sep 17 00:00:00 2001
  From: Hugh McMaster <hugh.mcmaster@outlook.com>
  Date: Wed, 5 Dec 2018 21:30:39 +1100
  Subject: [PATCH] ext/intl: Use pkg-config to detect icu
  


  
  Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
  ---
   acinclude.m4       | 58 ----------------------------------------------
  ext/intl/config.m4 | 20 ++++++++++++++--
  2 files changed, 18 insertions(+), 60 deletions(-)
  ext/intl/config.m4 | 15 ++++++++++--
  2 files changed, 13 insertions(+), 60 deletions(-)
  
  diff --git a/acinclude.m4 b/acinclude.m4
  index 728cb72654..8983615511 100644
  --- a/acinclude.m4
Line 81 (now 81), was 25 lines, now 20 lines

   dnl
   dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]])
   dnl
  diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
 index a80391bb58..5c6969b9a5 100644
 index a80391bb58..3a729890aa 100644
  --- a/ext/intl/config.m4
  +++ b/ext/intl/config.m4
 @@ -6,9 +6,25 @@ PHP_ARG_ENABLE(intl, whether to enable internationalization support,
 @@ -6,9 +6,20 @@ PHP_ARG_ENABLE(intl, whether to enable internationalization support,
   [  --enable-intl           Enable internationalization support])
   
   if test "$PHP_INTL" != "no"; then
  -  PHP_SETUP_ICU(INTL_SHARED_LIBADD)
 +  PKG_CHECK_MODULES([ICU], [icu-io >= 50.1],
 +                    [ICU_FOUND=true], [ICU_FOUND=false])
 +
 +  if test "$ICU_FOUND" = false; then
 +    AC_MSG_ERROR([icu version 50.1 or later is required for internationalization support.])
 +  fi
 +  PKG_CHECK_MODULES([ICU], [icu-io >= 50.1])
  +
  +  PHP_EVAL_INCLINE($ICU_CFLAGS)
 +  PHP_EVAL_LIBLINE($ICU_LIBS, $1)
 +  PHP_EVAL_LIBLINE($ICU_LIBS, INTL_SHARED_LIBADD)
  +
  +  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"
  +
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC