File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2243,6 +2243,7 @@ AC_DEFUN([PHP_SETUP_ICU],[
22432243 AC_MSG_ERROR ( [ ICU version 3.4 or later is required] )
22442244 fi
22452245
2246+ ICU_VERSION=$icu_version
22462247 ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
22472248 ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
22482249 PHP_EVAL_INCLINE($ICU_INCS)
Original file line number Diff line number Diff line change @@ -9,7 +9,14 @@ if test "$PHP_INTL" != "no"; then
99 PHP_SETUP_ICU(INTL_SHARED_LIBADD)
1010 PHP_SUBST(INTL_SHARED_LIBADD)
1111 PHP_REQUIRE_CXX()
12-
12+ if test "$icu_version" -ge "4002"; then
13+ icu_spoof_src=" spoofchecker/spoofchecker_class.c \
14+ spoofchecker/spoofchecker.c\
15+ spoofchecker/spoofchecker_create.c\
16+ spoofchecker/spoofchecker_main.c"
17+ else
18+ icu_spoof_src=""
19+ fi
1320 PHP_NEW_EXTENSION(intl, php_intl.c \
1421 intl_error.c \
1522 intl_convert.c \
@@ -59,11 +66,7 @@ if test "$PHP_INTL" != "no"; then
5966 transliterator/transliterator_class.c \
6067 transliterator/transliterator_methods.c \
6168 idn/idn.c \
62- spoofchecker/spoofchecker_class.c \
63- spoofchecker/spoofchecker.c\
64- spoofchecker/spoofchecker_create.c\
65- spoofchecker/spoofchecker_main.c, $ext_shared,,$ICU_INCS)
66-
69+ $icu_spoof_src, $ext_shared,,$ICU_INCS)
6770 PHP_ADD_BUILD_DIR($ext_builddir/collator)
6871 PHP_ADD_BUILD_DIR($ext_builddir/common)
6972 PHP_ADD_BUILD_DIR($ext_builddir/formatter)
Original file line number Diff line number Diff line change 7070
7171#include "idn/idn.h"
7272
73- #include "spoofchecker/spoofchecker_class.h"
74- #include "spoofchecker/spoofchecker.h"
75- #include "spoofchecker/spoofchecker_create.h"
76- #include "spoofchecker/spoofchecker_main.h"
73+ #if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
74+ # include "spoofchecker/spoofchecker_class.h"
75+ # include "spoofchecker/spoofchecker.h"
76+ # include "spoofchecker/spoofchecker_create.h"
77+ # include "spoofchecker/spoofchecker_main.h"
78+ #endif
7779
7880#include "msgformat/msgformat.h"
7981#include "common/common_error.h"
@@ -638,12 +640,13 @@ PHP_MINIT_FUNCTION( intl )
638640 /* Expose IDN constants to PHP scripts. */
639641 idn_register_constants (INIT_FUNC_ARGS_PASSTHRU );
640642
643+ #if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
641644 /* Register 'Spoofchecker' PHP class */
642645 spoofchecker_register_Spoofchecker_class ( TSRMLS_C );
643646
644647 /* Expose Spoofchecker constants to PHP scripts */
645648 spoofchecker_register_constants ( INIT_FUNC_ARGS_PASSTHRU );
646-
649+ #endif
647650 /* Global error handling. */
648651 intl_error_init ( NULL TSRMLS_CC );
649652
You can’t perform that action at this time.
0 commit comments