File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -774,10 +774,26 @@ su - postgres
774774 Build with support for
775775 the <productname>ICU</productname><indexterm><primary>ICU</></>
776776 library. This requires the <productname>ICU4C</productname> package
777- as well
778- as <productname>pkg-config</productname><indexterm><primary>pkg-config</></>
779777 to be installed. The minimum required version
780- of <productname>ICU4C</productname> is currently 4.6.
778+ of <productname>ICU4C</productname> is currently 4.2.
779+ </para>
780+
781+ <para>
782+ By default,
783+ <productname>pkg-config</productname><indexterm><primary>pkg-config</></>
784+ will be used to find the required compilation options. This is
785+ supported for <productname>ICU4C</productname> version 4.6 and later.
786+ For older versions, or if <productname>pkg-config</productname> is
787+ not available, the variables <envar>ICU_CFLAGS</envar>
788+ and <envar>ICU_LIBS</envar> can be specified
789+ to <filename>configure</filename>, like in this example:
790+ <programlisting>
791+ ./configure ... --with-icu ICU_CFLAGS='-I/some/where/include' ICU_LIBS='-L/some/where/lib -licui18n -licuuc -licudata'
792+ </programlisting>
793+ (If <productname>ICU4C</productname> is in the default search path
794+ for the compiler, then you still need to specify a nonempty string in
795+ order to avoid use of <productname>pkg-config</productname>, for
796+ example, <literal>ICU_CFLAGS=' '</literal>.)
781797 </para>
782798 </listitem>
783799 </varlistentry>
Original file line number Diff line number Diff line change @@ -722,7 +722,17 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
722722
723723 /*
724724 * Add keyword variants
725+ *
726+ * In ICU 4.2, ucol_getKeywordsForLocale() sometimes returns
727+ * values that will not be accepted by uloc_toLanguageTag(). Skip
728+ * loading keyword variants in that version. (Both
729+ * ucol_getKeywordValuesForLocale() and uloc_toLanguageTag() are
730+ * new in ICU 4.2, so older versions are not supported at all.)
731+ *
732+ * XXX We have no information about ICU 4.3 through 4.7, but we
733+ * know the below works with 4.8.
725734 */
735+ #if U_ICU_VERSION_MAJOR_NUM > 4 || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM > 2 )
726736 status = U_ZERO_ERROR ;
727737 en = ucol_getKeywordValuesForLocale ("collation" , name , TRUE, & status );
728738 if (U_FAILURE (status ))
@@ -769,6 +779,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS)
769779 (errmsg ("could not get keyword values for locale \"%s\": %s" ,
770780 name , u_errorName (status ))));
771781 uenum_close (en );
782+ #endif /* ICU >4.2 */
772783 }
773784 }
774785#endif /* USE_ICU */
You can’t perform that action at this time.
0 commit comments