1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 4<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> 5 <head> 6 <title>ReadMe for ICU 66.1</title> 7 <meta name="COPYRIGHT" content= 8 "Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html"/> 9 <!-- meta name="COPYRIGHT" content= 10 "Copyright (c) 1997-2016 IBM Corporation and others. All Rights Reserved." / --> 11 <meta name="KEYWORDS" content= 12 "ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" /> 13 <meta name="DESCRIPTION" content= 14 "The introduction to the International Components for Unicode with instructions on building, installation, usage and other information about ICU." /> 15 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 16 <link type="text/css" href="./icu4c.css" rel="stylesheet"/> 17 </head> 18 19<!-- 20 classes to use with the "body" - 21 draft - if the release note is itself a draft (May be combined with the other two) 22 rc - if the release note is a release candidate 23 milestone - if the release note is a milestone release 24--> 25 26 <body> 27 <!-- <body class="rc"> --> 28 <p class="only-draft"><b>Note:</b> This is a draft readme.</p> 29 30 <h1> 31 <span class="only-draft">DRAFT</span> 32 International Components for Unicode<br/> 33 <span class="only-rc">Release Candidate</span> 34 <!-- <span class="only-milestone">(Milestone Release)</span> --> 35 <span class="only-milestone">(Preview Release)</span> 36 <abbr title="International Components for Unicode">ICU</abbr> 66.1 ReadMe 37 </h1> 38 39 <!-- Most of the time we shouldn't need to comment/uncomment this paragraph, just change the body class --> 40 <!-- <p class="note only-milestone">This is a development milestone release of ICU 41 This milestone is intended for those wishing to get an early look at new features and API changes. 42 It is not recommended for production use.</p> --> 43 <p class="note only-milestone">This is a preview release of ICU. 44 It is not recommended for production use.</p> 45 46 <!-- Shouldn't need to comment/uncomment this paragraph, just change the body class --> 47 <p class="note only-rc">This is a release candidate version of ICU4C. 48 It is not recommended for production use.</p> 49 50 <p>Last updated: 2020-Mar-02<br/> 51 Copyright © 2016 and later: Unicode, Inc. and others. License & terms of use: 52 <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/> 53 Copyright © 1997-2016 International Business Machines Corporation and others. 54 All Rights Reserved.</p> 55 <!-- Remember that there is a copyright at the end too --> 56 <hr/> 57 58 <h2 class="TOC">Table of Contents</h2> 59 60 <ul class="TOC"> 61 <li><a href="#Introduction">Introduction</a></li> 62 63 <li><a href="#GettingStarted">Getting Started</a></li> 64 65 <li><a href="#News">What Is New In This Release?</a></li> 66 67 <li><a href="#Download">How To Download the Source Code</a></li> 68 69 <li><a href="#SourceCode">ICU Source Code Organization</a></li> 70 71 <li> 72 <a href="#HowToBuild">How To Build And Install ICU</a> 73 74 <ul > 75 <li><a href="#RecBuild">Recommended Build Options</a></li> 76 77 <li><a href="#UserConfig">User-Configurable Settings</a></li> 78 79 <li><a href="#HowToBuildWindows">Windows</a></li> 80 81 <li><a href="#HowToBuildCygwin">Cygwin</a></li> 82 83 <li><a href="#HowToBuildUNIX">UNIX</a></li> 84 85 <li><a href="#HowToBuildZOS">z/OS (os/390)</a></li> 86 87 <li><a href="#HowToBuildOS400">IBM i family (IBM i, i5/OS, OS/400)</a></li> 88 89 <li><a href="#HowToCrossCompileICU">How to Cross Compile ICU</a></li> 90 </ul> 91 </li> 92 93 94 <li><a href="#HowToPackage">How To Package ICU</a></li> 95 96 <li> 97 <a href="#ImportantNotes">Important Notes About Using ICU</a> 98 99 <ul > 100 <li><a href="#ImportantNotesMultithreaded">Using ICU in a Multithreaded 101 Environment</a></li> 102 103 <li><a href="#ImportantNotesWindows">Windows Platform</a></li> 104 105 <li><a href="#ImportantNotesUNIX">UNIX Type Platforms</a></li> 106 </ul> 107 </li> 108 109 <li> 110 <a href="#PlatformDependencies">Platform Dependencies</a> 111 112 <ul > 113 <li><a href="#PlatformDependenciesNew">Porting To A New 114 Platform</a></li> 115 116 <li><a href="#PlatformDependenciesImpl">Platform Dependent 117 Implementations</a></li> 118 </ul> 119 </li> 120 </ul> 121 <hr /> 122 123 <h2><a name="Introduction" href="#Introduction" id= 124 "Introduction">Introduction</a></h2> 125 126 <p>Today's software market is a global one in which it is desirable to 127 develop and maintain one application (single source/single binary) that 128 supports a wide variety of languages. The International Components for 129 Unicode (ICU) libraries provide robust and full-featured Unicode services on 130 a wide variety of platforms to help this design goal. The ICU libraries 131 provide support for:</p> 132 133 <ul> 134 <li>The latest version of the Unicode standard</li> 135 136 <li>Character set conversions with support for over 220 codepages</li> 137 138 <li>Locale data for more than 300 locales</li> 139 140 <li>Language sensitive text collation (sorting) and searching based on the 141 Unicode Collation Algorithm (=ISO 14651)</li> 142 143 <li>Regular expression matching and Unicode sets</li> 144 145 <li>Transformations for normalization, upper/lowercase, script 146 transliterations (50+ pairs)</li> 147 148 <li>Resource bundles for storing and accessing localized information</li> 149 150 <li>Date/Number/Message formatting and parsing of culture specific 151 input/output formats</li> 152 153 <li>Calendar specific date and time manipulation</li> 154 155 <li>Text boundary analysis for finding characters, word and sentence 156 boundaries</li> 157 </ul> 158 159 <p>ICU has a sister project ICU4J that extends the internationalization 160 capabilities of Java to a level similar to ICU. The ICU C/C++ project is also 161 called ICU4C when a distinction is necessary.</p> 162 163 <h2><a name="GettingStarted" href="#GettingStarted" id= 164 "GettingStarted">Getting started</a></h2> 165 166 <p>This document describes how to build and install ICU on your machine. For 167 other information about ICU please see the following table of links.<br /> 168 The ICU homepage also links to related information about writing 169 internationalized software.</p> 170 171 <table class="docTable" summary="These are some useful links regarding ICU and internationalization in general."> 172 <caption> 173 Here are some useful links regarding ICU and internationalization in 174 general. 175 </caption> 176 177 <tr> 178 <td>ICU, ICU4C & ICU4J Homepage</td> 179 180 <td><a href= 181 "http://icu-project.org/">http://icu-project.org/</a></td> 182 </tr> 183 184 <tr> 185 <td>FAQ - Frequently Asked Questions about ICU</td> 186 187 <td><a href= 188 "http://userguide.icu-project.org/icufaq">http://userguide.icu-project.org/icufaq</a></td> 189 </tr> 190 191 <tr> 192 <td>ICU User's Guide</td> 193 194 <td><a href= 195 "http://userguide.icu-project.org/">http://userguide.icu-project.org/</a></td> 196 </tr> 197 198 <tr> 199 <td>How To Use ICU</td> 200 201 <td><a href="http://userguide.icu-project.org/howtouseicu">http://userguide.icu-project.org/howtouseicu</a></td> 202 </tr> 203 204 <tr> 205 <td>Download ICU Releases</td> 206 207 <td><a href= 208 "http://site.icu-project.org/download">http://site.icu-project.org/download</a></td> 209 </tr> 210 211 <tr> 212 <td>ICU4C API Documentation Online</td> 213 214 <td><a href= 215 "http://icu-project.org/apiref/icu4c/">http://icu-project.org/apiref/icu4c/</a></td> 216 </tr> 217 218 <tr> 219 <td>Online ICU Demos</td> 220 221 <td><a href= 222 "http://demo.icu-project.org/icu-bin/icudemos">http://demo.icu-project.org/icu-bin/icudemos</a></td> 223 </tr> 224 225 <tr> 226 <td>Contacts and Bug Reports/Feature Requests</td> 227 228 <td><a href= 229 "http://site.icu-project.org/contacts">http://site.icu-project.org/contacts</a></td> 230 </tr> 231 </table> 232 233 <p><strong>Important:</strong> Please make sure you understand the <a href= 234 "http://source.icu-project.org/repos/icu/trunk/icu4c/LICENSE">Copyright and License Information</a>.</p> 235 236 237 <h2><a name="News" href="#News" id="News">What Is New In This Release?</a></h2> 238 239 <p>This release updates to Unicode 13 beta, CLDR 36.1, and includes some bug fixes. 240 This is a low-impact release with no other significant feature additions or implementation changes.</p> 241 242 <p>See the <a href="http://site.icu-project.org/download/66">ICU 66 download page</a> 243 for more information on this release, including any other changes, bug fixes, known issues, 244 changes to supported platforms and build environments, 245 and migration issues for existing applications migrating from previous ICU releases.</p> 246 247 <p>See the <a href="APIChangeReport.html">API Change Report</a> for a complete list of 248 APIs added, removed, or changed in this release.</p> 249 250 <p><a name="RecentPreviousChanges" id="RecentPreviousChanges"></a>For 251 changes in previous releases, see the 252 main <a href="http://site.icu-project.org/download">ICU download page</a> 253 with its version-specific subpages.</p> 254 255 256 <h2><a name="Download" href="#Download" id="Download">How To Download the 257 Source Code</a></h2> 258 259 <p>There are two ways to download ICU releases:</p> 260 261 <ul> 262 <li><strong>Official Release Snapshot:</strong><br /> 263 If you want to use ICU (as opposed to developing it), you should download 264 an official packaged version of the ICU source code. These versions are 265 tested more thoroughly than day-to-day development builds of the system, 266 and they are packaged in zip and tar files for convenient download. These 267 packaged files can be found at <a href= 268 "http://site.icu-project.org/download">http://site.icu-project.org/download</a>.<br /> 269 The packaged snapshots are named <strong>icu-nnnn.zip</strong> or 270 <strong>icu-nnnn.tgz</strong>, where nnnn is the version number. The .zip 271 file is used for Windows platforms, while the .tgz file is preferred on 272 most other platforms.<br /> 273 Please unzip this file. </li> 274 275 <li><strong>GitHub Source Repository:</strong><br /> 276 If you are interested in developing features, patches, or bug fixes for 277 ICU, you should probably be working with the latest version of the ICU 278 source code. You will need to clone and checkout the code from our GitHub repository to 279 ensure that you have the most recent version of all of the files. See our 280 <a href="http://site.icu-project.org/repository">source 281 repository</a> for details.</li> 282 </ul> 283 284 <h2><a name="SourceCode" href="#SourceCode" id="SourceCode">ICU Source Code 285 Organization</a></h2> 286 287 <p>In the descriptions below, <strong><i><ICU></i></strong> is the full 288 path name of the ICU directory (the top level directory from the distribution 289 archives) in your file system. You can also view the <a href= 290 "http://userguide.icu-project.org/design">ICU Architectural 291 Design</a> section of the User's Guide to see which libraries you need for 292 your software product. You need at least the data (<code>[lib]icudt</code>) 293 and the common (<code>[lib]icuuc</code>) libraries in order to use ICU.</p> 294 295 <table class="docTable" summary="The following files describe the code drop."> 296 <caption> 297 The following files describe the code drop. 298 </caption> 299 300 <tr> 301 <th scope="col">File</th> 302 303 <th scope="col">Description</th> 304 </tr> 305 306 <tr> 307 <td>readme.html</td> 308 309 <td>Describes the International Components for Unicode (this file)</td> 310 </tr> 311 312 <tr> 313 <td>LICENSE</td> 314 315 <td>Contains the text of the ICU license</td> 316 </tr> 317 </table> 318 319 <p><br /> 320 </p> 321 322 <table class="docTable" summary= 323 "The following directories contain source code and data files."> 324 <caption> 325 The following directories contain source code and data files. 326 </caption> 327 328 <tr> 329 <th scope="col">Directory</th> 330 331 <th scope="col">Description</th> 332 </tr> 333 334 <tr> 335 <td><i><ICU></i>/source/<b>common</b>/</td> 336 337 <td>The core Unicode and support functionality, such as resource bundles, 338 character properties, locales, codepage conversion, normalization, 339 Unicode properties, Locale, and UnicodeString.</td> 340 </tr> 341 342 <tr> 343 <td><i><ICU></i>/source/<b>i18n</b>/</td> 344 345 <td>Modules in i18n are generally the more data-driven, that is to say 346 resource bundle driven, components. These deal with higher-level 347 internationalization issues such as formatting, collation, text break 348 analysis, and transliteration.</td> 349 </tr> 350 351 <tr> 352 <td><i><ICU></i>/source/<b>layoutex</b>/</td> 353 354 <td>Contains the ICU paragraph layout engine.</td> 355 </tr> 356 357 <tr> 358 <td><i><ICU></i>/source/<b>io</b>/</td> 359 360 <td>Contains the ICU I/O library.</td> 361 </tr> 362 363 <tr> 364 <td><i><ICU></i>/source/<b>data</b>/</td> 365 366 <td> 367 <p>This directory contains the source data in text format, which is 368 compiled into binary form during the ICU build process. It contains 369 several subdirectories, in which the data files are grouped by 370 function. Note that the build process must be run again after any 371 changes are made to this directory.</p> 372 373 <p>If some of the following directories are missing, it's probably 374 because you got an official download. If you need the data source files 375 for customization, then please download the complete ICU source code from <a 376 href="http://site.icu-project.org/repository">the ICU repository</a>.</p> 377 378 <ul> 379 <li><b>in/</b> A directory that contains a pre-built data library for 380 ICU. A standard source code package will contain this file without 381 several of the following directories. This is to simplify the build 382 process for the majority of users and to reduce platform porting 383 issues.</li> 384 385 <li><b>brkitr/</b> Data files for character, word, sentence, title 386 casing and line boundary analysis.</li> 387 388 <li><b>coll/</b> Data for collation tailorings. The makefile 389 <b>colfiles.mk</b> contains the list of resource bundle files.</li> 390 391 <li><b>locales/</b> These .txt files contain ICU language and 392 culture-specific localization data. Two special bundles are 393 <b>root</b>, which is the fallback data and parent of other bundles, 394 and <b>index</b>, which contains a list of installed bundles. The 395 makefile <b>resfiles.mk</b> contains the list of resource bundle 396 files. Some of the locale data is split out into the type-specific 397 directories curr, lang, region, unit, and zone, described below.</li> 398 399 <li><b>curr/</b> Locale data for currency symbols and names (including 400 plural forms), with its own makefile <b>resfiles.mk</b>.</li> 401 402 <li><b>lang/</b> Locale data for names of languages, scripts, and locale 403 key names and values, with its own makefile <b>resfiles.mk</b>.</li> 404 405 <li><b>region/</b> Locale data for names of regions, with its own 406 makefile <b>resfiles.mk</b>.</li> 407 408 <li><b>unit/</b> Locale data for measurement unit patterns and names, 409 with its own makefile <b>resfiles.mk</b>.</li> 410 411 <li><b>zone/</b> Locale data for time zone names, with its own 412 makefile <b>resfiles.mk</b>.</li> 413 414 <li><b>mappings/</b> Here are the code page converter tables. These 415 .ucm files contain mappings to and from Unicode. These are compiled 416 into .cnv files. <b>convrtrs.txt</b> is the alias mapping table from 417 various converter name formats to ICU internal format and vice versa. 418 It produces cnvalias.icu. The makefiles <b>ucmfiles.mk, 419 ucmcore.mk,</b> and <b>ucmebcdic.mk</b> contain the list of 420 converters to be built.</li> 421 422 <li><b>translit/</b> This directory contains transliterator rules as 423 resource bundles, a makefile <b>trnsfiles.mk</b> containing the list 424 of installed system translitaration files, and as well the special 425 bundle <b>translit_index</b> which lists the system transliterator 426 aliases.</li> 427 428 <li><b>unidata/</b> This directory contains the Unicode data files. 429 Please see <a href= 430 "http://www.unicode.org/">http://www.unicode.org/</a> for more 431 information.</li> 432 433 <li><b>misc/</b> The misc directory contains other data files which 434 did not fit into the above categories, including time zone 435 information, region-specific data, and other data derived from CLDR 436 supplemental data.</li> 437 438 <li><b>out/</b> This directory contains the assembled memory mapped 439 files.</li> 440 441 <li><b>out/build/</b> This directory contains intermediate (compiled) 442 files, such as .cnv, .res, etc.</li> 443 </ul> 444 445 <p>If you are creating a special ICU build, you can set the ICU_DATA 446 environment variable to the out/ or the out/build/ directories, but 447 this is generally discouraged because most people set it incorrectly. 448 You can view the <a href= 449 "http://userguide.icu-project.org/icudata">ICU Data 450 Management</a> section of the ICU User's Guide for details.</p> 451 </td> 452 </tr> 453 454 <tr> 455 <td><i><ICU></i>/source/test/<b>intltest</b>/</td> 456 457 <td>A test suite including all C++ APIs. For information about running 458 the test suite, see the build instructions specific to your platform 459 later in this document.</td> 460 </tr> 461 462 <tr> 463 <td><i><ICU></i>/source/test/<b>cintltst</b>/</td> 464 465 <td>A test suite written in C, including all C APIs. For information 466 about running the test suite, see the build instructions specific to your 467 platform later in this document.</td> 468 </tr> 469 470 <tr> 471 <td><i><ICU></i>/source/test/<b>iotest</b>/</td> 472 473 <td>A test suite written in C and C++ to test the icuio library. For 474 information about running the test suite, see the build instructions 475 specific to your platform later in this document.</td> 476 </tr> 477 478 <tr> 479 <td><i><ICU></i>/source/test/<b>testdata</b>/</td> 480 481 <td>Source text files for data, which are read by the tests. It contains 482 the subdirectories <b>out/build/</b> which is used for intermediate 483 files, and <b>out/</b> which contains <b>testdata.dat.</b></td> 484 </tr> 485 486 <tr> 487 <td><i><ICU></i>/source/<b>tools</b>/</td> 488 489 <td>Tools for generating the data files. Data files are generated by 490 invoking <i><ICU></i>/source/data/build/makedata.bat on Win32 or 491 <i><ICU></i>/source/make on UNIX.</td> 492 </tr> 493 494 <tr> 495 <td><i><ICU></i>/source/<b>samples</b>/</td> 496 497 <td>Various sample programs that use ICU</td> 498 </tr> 499 500 <tr> 501 <td><i><ICU></i>/source/<b>extra</b>/</td> 502 503 <td>Non-supported API additions. Currently, it contains the 'uconv' tool 504 to perform codepage conversion on files.</td> 505 </tr> 506 507 <tr> 508 <td><i><ICU></i>/<b>packaging</b>/</td> 509 510 <td>This directory contain scripts and tools for packaging the final 511 ICU build for various release platforms.</td> 512 </tr> 513 514 <tr> 515 <td><i><ICU></i>/source/<b>config</b>/</td> 516 517 <td>Contains helper makefiles for platform specific build commands. Used 518 by 'configure'.</td> 519 </tr> 520 521 <tr> 522 <td><i><ICU></i>/source/<b>allinone</b>/</td> 523 524 <td>Contains top-level ICU workspace and project files, for instance to 525 build all of ICU under one MSVC project.</td> 526 </tr> 527 528 <tr> 529 <td><i><ICU></i>/<b>include</b>/</td> 530 531 <td>Contains the headers needed for developing software that uses ICU on 532 Windows.</td> 533 </tr> 534 535 <tr> 536 <td><i><ICU></i>/<b>lib</b>/</td> 537 538 <td>Contains the import libraries for linking ICU into your Windows 539 application.</td> 540 </tr> 541 542 <tr> 543 <td><i><ICU></i>/<b>bin</b>/</td> 544 545 <td>Contains the libraries and executables for using ICU on Windows.</td> 546 </tr> 547 </table> 548 <!-- end of ICU structure ==================================== --> 549 550 <h2><a name="HowToBuild" href="#HowToBuild" id="HowToBuild">How To Build And 551 Install ICU</a></h2> 552 553 <h3><a name="RecBuild" href="#RecBuild" id= 554 "RecBuild">Recommended Build Options</a></h3> 555 556 <p>Depending on the platform and the type of installation, 557 we recommend a small number of modifications and build options. 558 Note that C99 compatibility is now required.</p> 559 <ul> 560 <li><b>Namespace (ICU 61 and later):</b> 561 Since ICU 61, call sites need to qualify ICU types explicitly, 562 for example <code>icu::UnicodeString</code>, 563 or do <code>using icu::UnicodeString;</code> where appropriate. 564 If your code relies on the "using namespace icu;" that used to be in unicode/uversion.h, 565 then you need to update your code.<br /> 566 You could temporarily (until you have more time to update your code) 567 revert to the default "using" 568 via <code>-DU_USING_ICU_NAMESPACE=1</code> 569 or by modifying unicode/uversion.h: 570<pre>Index: icu4c/source/common/unicode/uversion.h 571=================================================================== 572--- icu4c/source/common/unicode/uversion.h (revision 40704) 573+++ icu4c/source/common/unicode/uversion.h (working copy) 574@@ -127,7 +127,7 @@ 575 defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION) 576 # define U_USING_ICU_NAMESPACE 0 577 # else 578-# define U_USING_ICU_NAMESPACE 0 579+# define U_USING_ICU_NAMESPACE 1 580 # endif 581 # endif 582 # if U_USING_ICU_NAMESPACE 583</pre> 584 </li> 585 <li><b>Namespace (ICU 60 and earlier):</b> By default, unicode/uversion.h has 586 "using namespace icu;" which defeats much of the purpose of the namespace. 587 (This is for historical reasons: Originally, ICU4C did not use namespaces, 588 and some compilers did not support them. The default "using" statement 589 preserves source code compatibility.)<br /> 590 You should turn this off 591 via <code>-DU_USING_ICU_NAMESPACE=0</code> 592 or by modifying unicode/uversion.h: 593<pre>Index: source/common/unicode/uversion.h 594=================================================================== 595--- source/common/unicode/uversion.h (revision 26606) 596+++ source/common/unicode/uversion.h (working copy) 597@@ -180,7 +180,8 @@ 598 # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 599 600 # ifndef U_USING_ICU_NAMESPACE 601-# define U_USING_ICU_NAMESPACE 1 602+ // Set to 0 to force namespace declarations in ICU usage. 603+# define U_USING_ICU_NAMESPACE 0 604 # endif 605 # if U_USING_ICU_NAMESPACE 606 U_NAMESPACE_USE 607</pre> 608 ICU call sites then either qualify ICU types explicitly, 609 for example <code>icu::UnicodeString</code>, 610 or do <code>using icu::UnicodeString;</code> where appropriate.</li> 611 <li><b>Hardcode the default charset to UTF-8:</b> On platforms where 612 the default charset is always UTF-8, 613 like MacOS X and some Linux distributions, 614 we recommend hardcoding ICU's default charset to UTF-8. 615 This means that some implementation code becomes simpler and faster, 616 and statically linked ICU libraries become smaller. 617 (See the <a href="http://icu-project.org/apiref/icu4c/platform_8h.html#a0a33e1edf3cd23d9e9c972b63c9f7943">U_CHARSET_IS_UTF8</a> 618 API documentation for more details.)<br /> 619 You can <code>-DU_CHARSET_IS_UTF8=1</code> or 620 modify unicode/utypes.h (in ICU 4.8 and below) 621 or modify unicode/platform.h (in ICU 49 and higher): 622<pre>Index: source/common/unicode/utypes.h 623=================================================================== 624--- source/common/unicode/utypes.h (revision 26606) 625+++ source/common/unicode/utypes.h (working copy) 626@@ -160,7 +160,7 @@ 627 * @see UCONFIG_NO_CONVERSION 628 */ 629 #ifndef U_CHARSET_IS_UTF8 630-# define U_CHARSET_IS_UTF8 0 631+# define U_CHARSET_IS_UTF8 1 632 #endif 633 634 /*===========================================================================*/ 635</pre></li> 636 <li><b>UnicodeString constructors:</b> The UnicodeString class has 637 several single-argument constructors that are not marked "explicit" 638 for historical reasons. 639 This can lead to inadvertent construction of a <code>UnicodeString</code> 640 with a single character by using an integer, 641 and it can lead to inadvertent dependency on the conversion framework 642 by using a C string literal.<br /> 643 Beginning with ICU 49, you should do the following: 644 <ul> 645 <li>Consider marking the from-<code>UChar</code> 646 and from-<code>UChar32</code> constructors explicit via 647 <code>-DUNISTR_FROM_CHAR_EXPLICIT=explicit</code> or similar.</li> 648 <li>Consider marking the from-<code>const char*</code> and 649 from-<code>const UChar*</code> constructors explicit via 650 <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code> or similar.</li> 651 </ul> 652 Note: The ICU test suites cannot be compiled with these settings. 653 </li> 654 <li><b>utf.h, utf8.h, utf16.h, utf_old.h:</b> 655 By default, utypes.h (and thus almost every public ICU header) 656 includes all of these header files. 657 Often, none of them are needed, or only one or two of them. 658 All of utf_old.h is deprecated or obsolete.<br /> 659 Beginning with ICU 49, 660 you should define <code>U_NO_DEFAULT_INCLUDE_UTF_HEADERS</code> to 1 661 (via -D or uconfig.h, as above) 662 and include those header files explicitly that you actually need.<br /> 663 Note: The ICU test suites cannot be compiled with this setting.</li> 664 <li><b>utf_old.h:</b> 665 All of utf_old.h is deprecated or obsolete.<br /> 666 Beginning with ICU 60, 667 you should define <code>U_HIDE_OBSOLETE_UTF_OLD_H</code> to 1 668 (via -D or uconfig.h, as above). 669 Use of any of these macros should be replaced as noted 670 in the comments for the obsolete macro.<br /> 671 Note: The ICU test suites <i>can</i> be compiled with this setting.</li> 672 <li><b>.dat file:</b> By default, the ICU data is built into 673 a shared library (DLL). This is convenient because it requires no 674 install-time or runtime configuration, 675 but the library is platform-specific and cannot be modified. 676 A .dat package file makes the opposite trade-off: 677 Platform-portable (except for endianness and charset family, which 678 can be changed with the icupkg tool) 679 and modifiable (also with the icupkg tool). 680 If a path is set, then single data files (e.g., .res files) 681 can be copied to that location to provide new locale data 682 or conversion tables etc.<br /> 683 The only drawback with a .dat package file is that the application 684 needs to provide ICU with the file system path to the package file 685 (e.g., by calling <code>u_setDataDirectory()</code>) 686 or with a pointer to the data (<code>udata_setCommonData()</code>) 687 before other ICU API calls. 688 This is usually easy if ICU is used from an application where 689 <code>main()</code> takes care of such initialization. 690 It may be hard if ICU is shipped with 691 another shared library (such as the Xerces-C++ XML parser) 692 which does not control <code>main()</code>.<br /> 693 See the <a href="http://userguide.icu-project.org/icudata">User Guide ICU Data</a> 694 chapter for more details.<br /> 695 If possible, we recommend building the .dat package. 696 Specify <code>--with-data-packaging=archive</code> 697 on the configure command line, as in<br /> 698 <code>runConfigureICU Linux --with-data-packaging=archive</code><br /> 699 (Read the configure script's output for further instructions. 700 On Windows, the Visual Studio build generates both the .dat package 701 and the data DLL.)<br /> 702 Be sure to install and use the tiny stubdata library 703 rather than the large data DLL.</li> 704 <li><b>Static libraries:</b> It may make sense to build the ICU code 705 into static libraries (.a) rather than shared libraries (.so/.dll). 706 Static linking reduces the overall size of the binary by removing 707 code that is never called.<br /> 708 Example configure command line:<br /> 709 <code>runConfigureICU Linux --enable-static --disable-shared</code></li> 710 <li><b>Out-of-source build:</b> It is usually desirable to keep the ICU 711 source file tree clean and have build output files written to 712 a different location. This is called an "out-of-source build". 713 Simply invoke the configure script from the target location: 714<pre>~/icu$ git clone export https://github.com/unicode-org/icu.git 715~/icu$ mkdir icu4c-build 716~/icu$ cd icu4c-build 717~/icu/icu4c-build$ ../icu/icu4c/source/runConfigureICU Linux 718~/icu/icu4c-build$ make check</pre><br/> 719 (Note: this example shows a relative path to 720 <code>runConfigureICU</code>. If you experience difficulty, 721 try using an absolute path to <code>runConfigureICU</code> 722 instead.) 723 </li> 724 </ul> 725 <h4>ICU as a System-Level Library</h4> 726 <p>If ICU is installed as a system-level library, there are further 727 opportunities and restrictions to consider. 728 For details, see the <em>Using ICU as an Operating System Level Library</em> 729 section of the <a href="http://userguide.icu-project.org/design">User Guide ICU Architectural Design</a> chapter.</p> 730 <ul> 731 <li><b>Data path:</b> For a system-level library, it is best to load 732 ICU data from the .dat package file because the file system path 733 to the .dat package file can be hardcoded. ICU will automatically set 734 the path to the final install location using U_ICU_DATA_DEFAULT_DIR. 735 Alternatively, you can set <code>-DICU_DATA_DIR=/path/to/icu/data</code> 736 when building the ICU code. (Used by source/common/putil.c.)<br/> 737 Consider also setting <code>-DICU_NO_USER_DATA_OVERRIDE</code> 738 if you do not want the "ICU_DATA" environment variable to be used. 739 (An application can still override the data path via 740 <code>u_setDataDirectory()</code> or 741 <code>udata_setCommonData()</code>.</li> 742 <li><b>Hide draft API:</b> API marked with <code>@draft</code> 743 is new and not yet stable. Applications must not rely on unstable 744 APIs from a system-level library. 745 Define <code>U_HIDE_DRAFT_API</code>, <code>U_HIDE_INTERNAL_API</code> 746 and <code>U_HIDE_SYSTEM_API</code> 747 by modifying unicode/utypes.h before installing it.</li> 748 <li><b>Only C APIs:</b> Applications must not rely on C++ APIs from a 749 system-level library because binary C++ compatibility 750 across library and compiler versions is very hard to achieve. 751 Most ICU C++ APIs are in header files that contain a comment with 752 <code>\brief C++ API</code>. 753 Consider not installing these header files, or define <code>U_SHOW_CPLUSPLUS_API</code> 754 to be <code>0</code> by modifying unicode/utypes.h before installing it.</li> 755 <li><b>Disable renaming:</b> By default, ICU library entry point names 756 have an ICU version suffix. Turn this off for a system-level installation, 757 to enable upgrading ICU without breaking applications. For example:<br /> 758 <code>runConfigureICU Linux --disable-renaming</code><br /> 759 The public header files from this configuration must be installed 760 for applications to include and get the correct entry point names.</li> 761 </ul> 762 763 <h3><a name="UserConfig" href="#UserConfig" id="UserConfig">User-Configurable Settings</a></h3> 764 <p>ICU4C can be customized via a number of user-configurable settings. 765 Many of them are controlled by preprocessor macros which are 766 defined in the <code>source/common/unicode/uconfig.h</code> header file. 767 Some turn off parts of ICU, for example conversion or collation, 768 trading off a smaller library for reduced functionality. 769 Other settings are recommended (see previous section) 770 but their default values are set for better source code compatibility.</p> 771 772 <p>In order to change such user-configurable settings, you can 773 either modify the <code>uconfig.h</code> header file by adding 774 a specific <code>#define ...</code> for one or more of the macros 775 before they are first tested, 776 or set the compiler's preprocessor flags (<code>CPPFLAGS</code>) to include 777 an equivalent <code>-D</code> macro definition.</p> 778 779 <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id= 780 "HowToBuildWindows">How To Build And Install On Windows</a></h3> 781 782 <p>Building International Components for Unicode requires:</p> 783 784 <ul> 785 <li>Microsoft Windows</li> 786 787 <li>Microsoft Visual C++ (part of <a href="https://www.visualstudio.com/">Visual Studio</a>) (from either Visual Studio 2015 or Visual Studio 2017)</li> 788 789 <li><i><b>Optional:</b></i> A version of the <a href="https://developer.microsoft.com/windows/downloads">Windows 10 SDK</a> (if you want to build the UWP projects)</li> 790 </ul> 791 <p class="note"><a href="#HowToBuildCygwin">Cygwin</a> is required if using a version of MSVC other than the one 792 compatible with the supplied project files or if other compilers are used to build ICU. (e.g. GCC)</p> 793 794 <p>The steps are:</p> 795 796 <ol> 797 <li>Unzip the <tt>icu-XXXX.zip</tt> file into any convenient location.<br/> 798 <ul class="no-left-margin"> 799 <li>You can use the built-in zip functionality of Windows Explorer to do this. 800 Right-click on the .zip file and choose the "Extract All" option from the context menu. 801 This will open a new window where you can choose the output location to put the files.</li> 802 <li>Alternatively, you can use a 3<sup>rd</sup> party GUI tool like 7-Zip or WinZip to do this as well.</li> 803 </ul> 804 </li> 805 806 <li>Be sure that the ICU binary directory, (ex: <i><ICU></i><tt>\bin\</tt>), is 807 included in the <strong>PATH</strong> environment variable. The tests will 808 not work without the location of the ICU DLL files in the path. 809 Note that the binary directory name can depend on what architecture you select when you compile ICU. 810 For x86 or 32-bit builds, the binary directory is "<tt>bin</tt>". Whereas for x64 or 64-bit builds 811 the binary directory is "<tt>bin64</tt>". 812 </li> 813 814 <li>Open the "<i><ICU></i><tt>\source\allinone\allinone.sln</tt>" solution 815 file in 'Visual Studio 2017'. (This solution includes all the 816 International Components for Unicode libraries, necessary ICU building 817 tools, and the test suite projects). Please see the 818 <a href="#HowToBuildWindowsCommandLine">command line note below</a> if you want to 819 build from the command line instead.</li> 820 821 <li>If you are building using 'Visual Studio 2015' instead, or if you are building the UWP projects and you have a different 822 version of the Windows 10 SDK installed you will first need to modify the two "<tt>Build.Windows.*.props</tt>" files 823 in the "<tt>allinone</tt>" directory before you can open the "allinone" solution file. 824 Please see the notes below about <a href="#HowToUseOtherVSVersions">building with other versions of Visual Studio</a> and the 825 notes on <a href="#HowToRetargetTheWin10SDK">re-targeting the Windows 10 SDK for the UWP projects</a> for details. Alternatively, 826 you can <a href="#HowToSkipBuildingUWP">skip building the UWP projects</a> entirely as well. 827 </li> 828 829 <li>Set the active platform to "Win32" or "x64" (See <a href="#HowToBuildWindowsPlatform">Windows platform note</a> below) 830 and configuration to "Debug" or "Release" (See <a href="#HowToBuildWindowsConfig">Windows configuration note</a> below).</li> 831 832 <li>Choose the "Build" menu and select "Rebuild Solution". If you want to 833 build the Debug and Release at the same time, see the <a href= 834 "#HowToBuildWindowsBatch">batch configuration note</a> below.</li> 835 836 <li>Run the tests. They can be run from the command line or from within Visual Studio. 837 838 <h4>Running the Tests from the Windows Command Line (cmd)</h4> 839 <ul> 840 <li>The general syntax is:<br /> 841 <div class="indent"> 842 <tt><i><ICU></i>\source\allinone\icucheck.bat <i>Platform</i> <i>Configuration</i></tt> 843 </div> 844 </li> 845 <li>So, for example for x86 (32-bit) and Debug, use the following:<br /> 846 <samp><i><ICU></i>\source\allinone\icucheck.bat <b>x86</b> <b>Debug</b></samp> 847 For x86 (32-bit) and Release: 848 <samp><i><ICU></i>\source\allinone\icucheck.bat <b>x86</b> <b>Release</b></samp> 849 For x64 (64-bit) and Debug: 850 <samp><i><ICU></i>\source\allinone\icucheck.bat <b>x64</b> <b>Debug</b></samp> 851 For x64 (64-bit) and Release: 852 <samp><i><ICU></i>\source\allinone\icucheck.bat <b>x64</b> <b>Release</b></samp> 853 </li> 854 </ul> 855 856 <h4>Running the Tests from within Visual Studio</h4> 857 858 <ol> 859 <li>Run the C++ test suite, "<tt>intltest</tt>". To do this: set the active startup 860 project to "intltest", and press Ctrl+F5 to run it. Make sure that it 861 passes without any errors.</li> 862 863 <li>Run the C test suite, "<tt>cintltst</tt>". To do this: set the active startup 864 project to "cintltst", and press Ctrl+F5 to run it. Make sure that it 865 passes without any errors.</li> 866 867 <li>Run the I/O test suite, "<tt>iotest</tt>". To do this: set the active startup 868 project to "iotest", and press Ctrl+F5 to run it. Make sure that it passes 869 without any errors.</li> 870 </ol> 871 </li> 872 873 <li>You are now able to develop applications with ICU by using the 874 libraries and tools in <tt><i><ICU></i>\bin\</tt>. The headers are in 875 <tt><i><ICU></i>\include\</tt> and the link libraries are in 876 <tt><i><ICU></i>\lib\</tt>. To install the ICU runtime on a machine, or ship 877 it with your application, copy the needed components from 878 <tt><i><ICU></i>\bin\</tt> to a location on the system PATH or to your 879 application directory.</li> 880 </ol> 881 882 <p><a name="HowToUseOtherVSVersions" id="HowToUseOtherVSVersions"> 883 <strong>Building with other versions of Visual Studio Note:</strong></a> 884 The particular version of the MSVC compiler tool-set (and thus the corresponding version of Visual Studio) that 885 is used to compile ICU is determined by the "<tt>PlatformToolset</tt>" property. This property is stored in two 886 different shared files that are used to set common configuration settings amongst the various ICU "<tt>*.vcxproj</tt>" project files. 887 888 For the non-UWP projects, this setting is in the shared file called "<tt>Build.Windows.ProjectConfiguration.props</tt>" located 889 in the "allinone" directory. 890 891 For the UWP projects, this setting is in the shared file called "<tt>Build.Windows.UWP.ProjectConfiguration.props</tt>", also 892 located in the "allinone" directory. 893 <br/> 894 The value of <tt>v140</tt> corresponds to the Visual Studio 2015 compiler tool set, whereas the value of 895 <tt>v141</tt> corresponds to the Visual Studio 2017 compiler tool set. 896 897 <br/>In order to build the non-UWP projects with Visual Studio 2015 you will need to modify the file 898 called "<tt>Build.Windows.ProjectConfiguration.props</tt>" to change the value of the <tt>PlatformToolset</tt> property. 899 900 Note however that Visual Studio 2017 is required for building the UWP projects. 901 </p> 902 903 <p>Please consider: Using older versions of the MSVC compiler is generally not recommended due to the improved support for the C++11 standard 904 in newer versions of the compiler.</p> 905 906 <p><a name="HowToRetargetTheWin10SDK" id="HowToRetargetTheWin10SDK"> 907 <strong>Re-targeting the Windows 10 SDK for the UWP projects Note:</strong></a> 908 909 If the version of the Windows 10 SDK that you have installed does not match the version used by the UWP projects, then you 910 will need to "retarget" them to use the version of the SDK that you have installed instead. 911 912 There are two ways to do this: 913 <ul> 914 <li>In Visual Studio you can right-click on the UWP projects in the 'Solution Explorer' and select the 915 option 'Retarget Projects' from the context menu. This will open up a window where you can select the 916 SDK version to target from a drop-down list of the various SDKs that are installed on the machine.</li> 917 918 <li>Alternatively, you can manually edit the shared file called "<tt>Build.Windows.UWP.ProjectConfiguration.props</tt>" 919 which is located in the "allinone" directory. You will need to change the of the 920 "<tt>WindowsTargetPlatformVersion</tt>" property to the version of the SDK that you would like to use instead.</li> 921 </ul> 922 </p> 923 924 <p><a name="HowToBuildWindowsCommandLine" id= 925 "HowToBuildWindowsCommandLine"><strong>Using MSBUILD At The Command Line Note:</strong></a> 926 You can build ICU from the command line instead of using the Visual Studio GUI. 927 928 Assuming that you have properly installed Visual Studio to support command line building, you 929 should have a shortcut for the "Developer Command Prompt" listed in the Start Menu. 930 (For Visual Studio 2017 you will need to install the "Desktop development with C++" option).</p> 931 932 <ul> 933 <li>Open the "Developer Command Prompt" shortcut from the Start Menu. (This will open up a new command line window).</li> 934 <li>From within the "Developer Command Prompt" change directory (<tt>cd</tt>) to the ICU source directory.</li> 935 <li>You can then use either '<tt>msbuild</tt>' directly, or you can use the '<tt>devenv.com</tt>' command to build ICU.</li> 936 <li>Using <tt>MSBUILD</tt>:</li> 937 <ul class="no-left-margin"> 938 <li>To build the 32-bit Debug version, use the following command line:<br/> 939 <code>'msbuild source\allinone\allinone.sln /p:Configuration=Debug /p:Platform=Win32'</code>.</li> 940 <li>To build the 64-bit Release version, use the following command line:<br/> 941 <code>'msbuild source\allinone\allinone.sln /p:Configuration=Release /p:Platform=x64'</code>.</li> 942 </ul> 943 <li>Using <tt>devenv.com</tt>:</li> 944 <ul class="no-left-margin"> 945 <li>To build the 32-bit Debug version, use the following command line:<br/> 946 <code>'devenv.com source\allinone\allinone.sln /build "Debug|Win32"'</code>.</li> 947 <li>To build the 64-bit Release version, use the following command line:<br/> 948 <code>'devenv.com source\allinone\allinone.sln /build "Release|x64"'</code>.</li> 949 </ul> 950 </ul> 951 952 <p><a name="HowToSkipBuildingUWP" id= 953 "HowToSkipBuildingUWP"><strong>Skipping the UWP Projects on the Command Line Note:</strong></a> 954 You can skip (or omit) building the UWP projects on the command line by passing the argument 955 '<code>SkipUWP=true</code>' to either MSBUILD or devenv.</p> 956 957 <ul> 958 <li>For example, using <tt>MSBUILD</tt>:</li> 959 <ul class="no-left-margin"> 960 <li>To skip building the UWP projects with a 32-bit Debug build, use the following command line:<br/> 961 <code>'msbuild source\allinone\allinone.sln /p:Configuration=Debug /p:Platform=Win32 /p:SkipUWP=true'</code>.</li> 962 <li>To skip building the UWP projects with a 64-bit Release version, use the following command line:<br/> 963 <code>'msbuild source\allinone\allinone.sln /p:Configuration=Release /p:Platform=x64 /p:SkipUWP=true'</code>.</li> 964 </ul> 965 </ul> 966 967 <p>You can also use Cygwin with the MSVC compiler to build ICU, and you can refer to the <a href= 968 "#HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a> 969 section for more details.</p> 970 971 <p><a name="HowToBuildWindowsPlatform" id= 972 "HowToBuildWindowsPlatform"><strong>Setting Active Platform 973 Note:</strong></a> Even though you are able to select "x64" as the active platform, if your operating system is 974 not a 64 bit version of Windows, the build will fail. To set the active platform, two different possibilities are:</p> 975 976 <ul> 977 <li>Choose "Build" menu, select "Configuration Manager...", and select 978 "Win32" or "x64" for the Active Platform Solution.</li> 979 980 <li>Another way is to select the desired build configuration from "Solution 981 Platforms" dropdown menu from the standard toolbar. It will say 982 "Win32" or "x64" in the dropdown list.</li> 983 </ul> 984 985 <p><a name="HowToBuildWindowsConfig" id= 986 "HowToBuildWindowsConfig"><strong>Setting Active Configuration 987 Note:</strong></a> To set the active configuration, two different 988 possibilities are:</p> 989 990 <ul> 991 <li>Choose "Build" menu, select "Configuration Manager...", and select 992 "Release" or "Debug" for the Active Configuration Solution.</li> 993 994 <li>Another way is to select the desired build configuration from "Solution 995 Configurations" dropdown menu from the standard toolbar. It will say 996 "Release" or "Debug" in the dropdown list.</li> 997 </ul> 998 999 <p><a name="HowToBuildWindowsBatch" id="HowToBuildWindowsBatch"><strong>Batch 1000 Configuration Note:</strong></a> If you want to build the Win32 and x64 platforms and 1001 Debug and Release configurations at the same time, choose "Build" menu, and select "Batch 1002 Build...". Click the "Select All" button, and then click the "Rebuild" 1003 button.</p> 1004 1005 <h3><a name="HowToBuildCygwin" href="#HowToBuildCygwin" id= 1006 "HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a></h3> 1007 1008 <p>Building International Components for Unicode with this configuration 1009 requires:</p> 1010 1011 <ul> 1012 <li>Microsoft Windows</li> 1013 1014 <li>Microsoft Visual C++ (from Visual Studio 2015 or newer, when gcc isn't used).</li> 1015 1016 <li> 1017 Cygwin with the following installed: 1018 1019 <ul> 1020 <li>bash</li> 1021 1022 <li>GNU make</li> 1023 1024 <li>ar</li> 1025 1026 <li>ranlib</li> 1027 1028 <li>man (if you plan to look at the man pages)</li> 1029 </ul> 1030 </li> 1031 </ul> 1032 1033 <p>There are two ways you can build ICU with Cygwin. You can build with gcc 1034 or Microsoft Visual C++. If you use gcc, the resulting libraries and tools 1035 will depend on the Cygwin environment. If you use Microsoft Visual C++, the 1036 resulting libraries and tools do not depend on Cygwin and can be more easily 1037 distributed to other Windows computers (the generated man pages and shell 1038 scripts still need Cygwin). To build with gcc, please follow the "<a href= 1039 "#HowToBuildUNIX">How To Build And Install On UNIX</a>" instructions, while 1040 you are inside a Cygwin bash shell. To build with Microsoft Visual C++, 1041 please use the following instructions:</p> 1042 1043 <ol> 1044 <li>Start the Windows "Command Prompt" window. This is different from the 1045 gcc build, which requires the Cygwin Bash command prompt. The Microsoft 1046 Visual C++ compiler will not work with a bash command prompt.</li> 1047 1048 <li>If the computer isn't set up to use Visual C++ from the command line, 1049 you need to run vcvars32.bat.<br />For example:<br /> 1050 "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat</tt>" 1051 can be used for 32-bit builds <strong>or</strong> <br /> 1052 "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14\VC\bin\x86_amd64\vcvarsx86_amd64.bat</tt>" 1053 can be used for 64-bit builds on Windows x64.</li> 1054 1055 <li>Unzip the icu-XXXX.zip file into any convenient location. Using command 1056 line zip, type "unzip -a icu-XXXX.zip -d drive:\directory", or just use 1057 WinZip.</li> 1058 1059 <li>Change directory to "icu/source", which is where you unzipped ICU.</li> 1060 1061 <li>Run "<tt>bash <a href="source/runConfigureICU">./runConfigureICU</a> 1062 Cygwin/MSVC</tt>" (See <a href="#HowToWindowsConfigureICU">Windows 1063 configuration note</a> and non-functional configure options below).</li> 1064 1065 <li>Type <tt>"make"</tt> to compile the libraries and all the data files. 1066 This make command should be GNU make.</li> 1067 1068 <li>Optionally, type <tt>"make check"</tt> to run the test suite, which 1069 checks for ICU's functionality integrity (See <a href= 1070 "#HowToTestWithoutGmake">testing note</a> below).</li> 1071 1072 <li>Type <tt>"make install"</tt> to install ICU. If you used the --prefix= 1073 option on configure or runConfigureICU, ICU will be installed to the 1074 directory you specified. (See <a href="#HowToInstallICU">installation 1075 note</a> below).</li> 1076 </ol> 1077 1078 <p><a name="HowToWindowsConfigureICU" id= 1079 "HowToWindowsConfigureICU"><strong>Configuring ICU on Windows 1080 NOTE:</strong></a> </p> 1081 <p> 1082 Ensure that the order of the PATH is MSVC, Cygwin, and then other PATHs. The configure 1083 script needs certain tools in Cygwin (e.g. grep). 1084 </p> 1085 <p> 1086 Also, you may need to run <tt>"dos2unix.exe"</tt> on all of the scripts (e.g. configure) 1087 in the top source directory of ICU. To avoid this issue, you can download 1088 the ICU source for Unix platforms (icu-xxx.tgz). 1089 </p> 1090 <p>In addition to the Unix <a href= 1091 "#HowToConfigureICU">configuration note</a> the following configure options 1092 currently do not work on Windows with Microsoft's compiler. Some options can 1093 work by manually editing <tt>icu/source/common/unicode/pwin32.h</tt>, but 1094 manually editing the files is not recommended.</p> 1095 1096 <ul> 1097 <li><tt>--disable-renaming</tt></li> 1098 1099 <li><tt>--enable-tracing</tt></li> 1100 1101 <li><tt>--enable-rpath</tt></li> 1102 1103 <li><tt>--enable-static</tt> (Requires that U_STATIC_IMPLEMENTATION be 1104 defined in user code that links against ICU's static libraries.)</li> 1105 1106 <li><tt>--with-data-packaging=files</tt> (The pkgdata tool currently does 1107 not work in this mode. Manual packaging is required to use this mode.)</li> 1108 </ul> 1109 1110 <h3><a name="HowToBuildUNIX" href="#HowToBuildUNIX" id="HowToBuildUNIX">How 1111 To Build And Install On UNIX</a></h3> 1112 1113 <p>Building International Components for Unicode on UNIX requires:</p> 1114 1115 <ul> 1116 <li>A C++ compiler installed on the target machine (for example: gcc, CC, 1117 xlC_r, aCC, cxx, etc...).</li> 1118 1119 <li>An ANSI C compiler installed on the target machine (for example: 1120 cc).</li> 1121 1122 <li>A recent version of GNU make (3.80+).</li> 1123 1124 <li>For a list of z/OS tools please view the <a href="#HowToBuildZOS">z/OS 1125 build section</a> of this document for further details.</li> 1126 </ul> 1127 1128 <p>Here are the steps to build ICU:</p> 1129 1130 <ol> 1131 <li>Decompress the icu-<i>X</i>.<i>Y</i>.tgz (or 1132 icu-<i>X</i>.<i>Y</i>.tar.gz) file. For example, <samp>gunzip -d < icu-<i>X</i>.<i>Y</i>.tgz | tar xvf -</samp></li> 1133 1134 <li>Change directory to <code>icu/source</code>. 1135 <samp>cd icu/source</samp> 1136 </li> 1137 1138 <li>Some files may have the wrong permissions.<samp>chmod +x runConfigureICU configure install-sh</samp></li> 1139 1140 <li>Run the <span style='font-family: monospace;'><a href="source/runConfigureICU">runConfigureICU</a></span> 1141 script for your platform. (See <a href="#HowToConfigureICU">configuration 1142 note</a> below).</li> 1143 1144 <li>Now build: <samp>gmake</samp> (or just <code>make</code> if GNU make is the default make on 1145 your platform) to compile the libraries and all the data files. The proper 1146 name of the GNU make command is printed at the end of the configuration 1147 run, as in <tt>"You must use gmake to compile ICU"</tt>. 1148 <br/> 1149 Note that the compilation command output may be simplified on your platform. If this is the case, you will see just: 1150 <tt>gcc ... stubdata.c</tt> 1151 rather than 1152 <tt>gcc -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -D_REENTRANT -I../common -DU_ATTRIBUTE_DEPRECATED= -O2 -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c -DPIC -fPIC -o stubdata.o stubdata.c</tt> 1153 <br/> 1154 If you need to see the whole compilation line, use <span style='font-family: monospace;'>"gmake VERBOSE=1"</span>. The full compilation line will print if an error occurs. 1155 </li> 1156 1157 <li>Optionally,<samp>gmake check</samp> will run the test suite, which 1158 checks for ICU's functionality integrity (See <a href= 1159 "#HowToTestWithoutGmake">testing note</a> below).</li> 1160 1161 <li>To install, <samp>gmake install</samp> to install ICU. If you used the --prefix= 1162 option on configure or runConfigureICU, ICU will be installed to the 1163 directory you specified. (See <a href="#HowToInstallICU">installation 1164 note</a> below).</li> 1165 </ol> 1166 1167 <p><a name="HowToConfigureICU" id="HowToConfigureICU"><strong>Configuring ICU 1168 NOTE:</strong></a> Type <tt>"./runConfigureICU --help"</tt> for help on how 1169 to run it and a list of supported platforms. You may also want to type 1170 <tt>"./configure --help"</tt> to print the available configure options that 1171 you may want to give runConfigureICU. If you are not using the 1172 runConfigureICU script, or your platform is not supported by the script, you 1173 may need to set your CC, CXX, CFLAGS and CXXFLAGS environment variables, and 1174 type <tt>"./configure"</tt>. 1175 HP-UX users, please see this <a href="#ImportantNotesHPUX">note regarding 1176 HP-UX multithreaded build issues</a> with newer compilers. Solaris users, 1177 please see this <a href="#ImportantNotesSolaris">note regarding Solaris 1178 multithreaded build issues</a>.</p> 1179 1180 <p>ICU is built with strict compiler warnings enabled by default. If this 1181 causes excessive numbers of warnings on your platform, use the --disable-strict 1182 option to configure to reduce the warning level.</p> 1183 1184 <p><a name="HowToTestWithoutGmake" id="HowToTestWithoutGmake"><strong>Running 1185 The Tests From The Command Line NOTE:</strong></a> You may have to set 1186 certain variables if you with to run test programs individually, that is 1187 apart from "gmake check". The environment variable <strong>ICU_DATA</strong> 1188 can be set to the full pathname of the data directory to indicate where the 1189 locale data files and conversion mapping tables are when you are not using 1190 the shared library (e.g. by using the .dat archive or the individual data 1191 files). The trailing "/" is required after the directory name (e.g. 1192 "$Root/source/data/out/" will work, but the value "$Root/source/data/out" is 1193 not acceptable). You do not need to set <strong>ICU_DATA</strong> if the 1194 complete shared data library is in your library path.</p> 1195 1196 <p><a name="HowToInstallICU" id="HowToInstallICU"><strong>Installing ICU 1197 NOTE:</strong></a> Some platforms use package management tools to control the 1198 installation and uninstallation of files on the system, as well as the 1199 integrity of the system configuration. You may want to check if ICU can be 1200 packaged for your package management tools by looking into the "packaging" 1201 directory. (Please note that if you are using a snapshot of ICU from Git, it 1202 is probable that the packaging scripts or related files are not up to date 1203 with the contents of ICU at this time, so use them with caution).</p> 1204 1205 <h3><a name="HowToBuildZOS" href="#HowToBuildZOS" id="HowToBuildZOS">How To 1206 Build And Install On z/OS (OS/390)</a></h3> 1207 1208 <p>You can install ICU on z/OS or OS/390 (the previous name of z/OS), but IBM 1209 tests only the z/OS installation. You install ICU in a z/OS UNIX system 1210 services file system such as HFS or zFS. On this platform, it is important 1211 that you understand a few details:</p> 1212 1213 <ul> 1214 <li>The makedep and GNU make tools are required for building ICU. If it 1215 is not already installed on your system, it is available at the <a href= 1216 "http://www-03.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html">z/OS UNIX - 1217 Tools and Toys</a> site. The PATH environment variable should be updated to 1218 contain the location of this executable prior to build. Failure to add these 1219 tools to your PATH will cause ICU build failures or cause pkgdata to fail 1220 to run.</li> 1221 1222 <li>Since USS does not support using the mmap() function over NFS, it is 1223 recommended that you build ICU on a local filesystem. Once ICU has been 1224 built, you should not have this problem while using ICU when the data 1225 library has been built as a shared library, which is this is the default 1226 setting.</li> 1227 1228 <li>Encoding considerations: The source code assumes that it is compiled 1229 with codepage ibm-1047 (to be exact, the UNIX System Services variant of 1230 it). The pax command converts all of the source code files from ASCII to 1231 codepage ibm-1047 (USS) EBCDIC. However, some files are binary files and 1232 must not be converted, or must be converted back to their original state. 1233 You can use the <a href="as_is/os390/unpax-icu.sh">unpax-icu.sh</a> script 1234 to do this for you automatically. It will unpackage the tar file and 1235 convert all the necessary files for you automatically.</li> 1236 1237 <li>z/OS supports both native S/390 hexadecimal floating point and (with 1238 OS/390 2.6 and later) IEEE 754 binary floating point. This is a compile 1239 time option. Applications built with IEEE should use ICU DLLs that are 1240 built with IEEE (and vice versa). The environment variable IEEE390=0 will 1241 cause the z/OS version of ICU to be built without IEEE floating point 1242 support and use the native hexadecimal floating point. By default ICU is 1243 built with IEEE 754 support. Native floating point support is sufficient 1244 for codepage conversion, resource bundle and UnicodeString operations, but 1245 the Format APIs require IEEE binary floating point.</li> 1246 1247 <li>z/OS introduced the concept of Extra Performance Linkage (XPLINK) to 1248 bring performance improvement opportunities to call-intensive C and C++ 1249 applications such as ICU. XPLINK is enabled on a DLL-by-DLL basis, so if 1250 you are considering using XPLINK in your application that uses ICU, you 1251 should consider building the XPLINK-enabled version of ICU. You need to 1252 set ICU's environment variable <code>OS390_XPLINK=1</code> prior to 1253 invoking the make process to produce binaries that are enabled for 1254 XPLINK. The XPLINK option, which is available for z/OS 1.2 and later, 1255 requires the PTF PQ69418 to build XPLINK enabled binaries.</li> 1256 1257 <li>ICU requires XPLINK for the icuio library. If you want to use the 1258 rest of ICU without XPLINK, then you must use the --disable-icuio 1259 configure option.</li> 1260 1261 <li>The latest versions of z/OS use <a 1262 href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind6.htm">XPLINK 1263 version (C128) of the C++ standard library</a> by default. You may see <a 1264 href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind5.htm">an 1265 error</a> when running with XPLINK disabled. To avoid this error, 1266 set the following environment variable or similar: 1267 1268<pre><samp>export _CXX_PSYSIX="CEE.SCEELIB(C128N)":"CBC.SCLBSID(IOSTREAM,COMPLEX)"</samp></pre> 1269 </li> 1270 1271 <li>When building ICU data, the heap size may need to be increased with the following 1272 environment variable: 1273 1274<pre><samp>export _CEE_RUNOPTS="HEAPPOOLS(ON),HEAP(4M,1M,ANY,FREE,0K,4080)"</samp></pre> 1275 </li> 1276 1277 1278 <li>The rest of the instructions for building and testing ICU on z/OS with 1279 UNIX System Services are the same as the <a href="#HowToBuildUNIX">How To 1280 Build And Install On UNIX</a> section.</li> 1281 </ul> 1282 1283 <h4>z/OS (Batch/PDS) support outside the UNIX system services 1284 environment</h4> 1285 1286 <p>By default, ICU builds its libraries into the UNIX file system (HFS). In 1287 addition, there is a z/OS specific environment variable (OS390BATCH) to build 1288 some libraries into the z/OS native file system. This is useful, for example, 1289 when your application is externalized via Job Control Language (JCL).</p> 1290 1291 <p>The OS390BATCH environment variable enables non-UNIX support including the 1292 batch environment. When OS390BATCH is set, the libicui18n<i>XX</i>.dll, 1293 libicuuc<i>XX</i>.dll, and libicudt<i>XX</i>e.dll binaries are built into 1294 data sets (the native file system). Turning on OS390BATCH does not turn off 1295 the normal z/OS UNIX build. This means that the z/OS UNIX (HFS) DLLs will 1296 always be created.</p> 1297 1298 <p>Two additional environment variables indicate the names of the z/OS data 1299 sets to use. The LOADMOD environment variable identifies the name of the data 1300 set that contains the dynamic link libraries (DLLs) and the LOADEXP 1301 environment variable identifies the name of the data set that contains the 1302 side decks, which are normally the files with the .x suffix in the UNIX file 1303 system.</p> 1304 1305 <p>A data set is roughly equivalent to a UNIX or Windows file. For most kinds 1306 of data sets the operating system maintains record boundaries. UNIX and 1307 Windows files are byte streams. Two kinds of data sets are PDS and PDSE. Each 1308 data set of these two types contains a directory. It is like a UNIX 1309 directory. Each "file" is called a "member". Each member name is limited to 1310 eight bytes, normally EBCDIC.</p> 1311 1312 <p>Here is an example of some environment variables that you can set prior to 1313 building ICU:</p> 1314<pre> 1315<samp>OS390BATCH=1 1316LOADMOD=<i>USER</i>.ICU.LOAD 1317LOADEXP=<i>USER</i>.ICU.EXP</samp> 1318</pre> 1319 1320 <p>The PDS member names for the DLL file names are as follows:</p> 1321<pre> 1322<samp>IXMI<i>XX</i>IN --> libicui18n<i>XX</i>.dll 1323IXMI<i>XX</i>UC --> libicuuc<i>XX</i>.dll 1324IXMI<i>XX</i>DA --> libicudt<i>XX</i>e.dll</samp> 1325</pre> 1326 1327 <p>You should point the LOADMOD environment variable at a partitioned data 1328 set extended (PDSE) and point the LOADEXP environment variable at a 1329 partitioned data set (PDS). The PDSE can be allocated with the following 1330 attributes:</p> 1331<pre> 1332<samp>Data Set Name . . . : <i>USER</i>.ICU.LOAD 1333Management class. . : <i>**None**</i> 1334Storage class . . . : <i>BASE</i> 1335Volume serial . . . : <i>TSO007</i> 1336Device type . . . . : <i>3390</i> 1337Data class. . . . . : <i>LOAD</i> 1338Organization . . . : PO 1339Record format . . . : U 1340Record length . . . : 0 1341Block size . . . . : <i>32760</i> 13421st extent cylinders: 1 1343Secondary cylinders : 5 1344Data set name type : LIBRARY</samp> 1345</pre> 1346 1347 <p>The PDS can be allocated with the following attributes:</p> 1348<pre> 1349<samp>Data Set Name . . . : <i>USER</i>.ICU.EXP 1350Management class. . : <i>**None**</i> 1351Storage class . . . : <i>BASE</i> 1352Volume serial . . . : <i>TSO007</i> 1353Device type . . . . : <i>3390</i> 1354Data class. . . . . : <i>**None**</i> 1355Organization . . . : PO 1356Record format . . . : FB 1357Record length . . . : 80 1358Block size . . . . : <i>3200</i> 13591st extent cylinders: 3 1360Secondary cylinders : 3 1361Data set name type : PDS</samp> 1362</pre> 1363 1364 <h3><a name="HowToBuildOS400" href="#HowToBuildOS400" id= 1365 "HowToBuildOS400">How To Build And Install On The IBM i Family (IBM i, i5/OS OS/400)</a></h3> 1366 1367 <p>Before you start building ICU, ICU requires the following:</p> 1368 1369 <ul> 1370 <li>QSHELL interpreter installed (install base option 30, operating system) 1371 <!--li>QShell Utilities, PRPQ 5799-XEH (not required for V4R5)</li--></li> 1372 1373 <li>ILE C/C++ Compiler installed on the system</li> 1374 1375 <li>The latest IBM tools for Developers for IBM i — 1376 <a href='https://www-356.ibm.com/partnerworld/wps/servlet/ContentHandler/pw_com_porting_tools_index'>https://www-356.ibm.com/partnerworld/wps/servlet/ContentHandler/pw_com_porting_tools_index</a> 1377 <!-- formerly http://www.ibm.com/servers/enable/site/porting/tools/'>http://www.ibm.com/servers/enable/site/porting/tools/</a> --> 1378 <!-- formerly: http://www.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html --> 1379 </li> 1380 </ul> 1381 1382 <p>The following describes how to setup and build ICU. For background 1383 information, you should look at the <a href="#HowToBuildUNIX">UNIX build 1384 instructions</a>.</p> 1385 1386 <ol> 1387 <li> 1388 Copy the ICU source .tgz to the IBM i environment, as binary. 1389 Also, copy the <a href='as_is/os400/unpax-icu.sh'>unpax-icu.sh</a> script into the same directory, as a text file. 1390 </li> 1391 1392 <li> 1393 Create target library. This library will be the target for the 1394 resulting modules, programs and service programs. You will specify this 1395 library on the OUTPUTDIR environment variable. 1396<pre> 1397<samp>CRTLIB LIB(<i>libraryname</i>) 1398ADDENVVAR ENVVAR(OUTPUTDIR) VALUE('<i>libraryname</i>') REPLACE(*YES) </samp></pre> 1399 </li> 1400 1401 <li> 1402 Set up the following environment variables and job characteristics in your build process 1403<pre> 1404<samp>ADDENVVAR ENVVAR(MAKE) VALUE('gmake') REPLACE(*YES) 1405CHGJOB CCSID(37)</samp></pre></li> 1406 1407 <li>Fire up the QSH <i>(all subsequent commands are run inside the qsh session.)</i> 1408 <pre><samp>qsh</samp></pre> 1409 </li> 1410 1411 <li>Set up the PATH: <pre><samp>export PATH=/QIBM/ProdData/DeveloperTools/qsh/bin:$PATH:/QOpenSys/usr/bin</samp></pre> 1412 </li> 1413 1414 <li>Unpack the ICU source code archive: 1415 <pre><samp>gzip -d icu-<i>X</i>.<i>Y</i>.tgz</samp></pre> 1416 </li> 1417 1418 <li>Run unpax-icu.sh on the tar file generated from the previous step. 1419 <pre><samp>unpax-icu.sh icu.tar</samp></pre></li> 1420 1421 <li>Build the program ICULD which ICU will use for linkage. 1422 <pre><samp>cd icu/as_is/os400 1423qsh bldiculd.sh 1424cd ../../..</samp></pre> 1425 </li> 1426 1427 <li>Change into the 'source' directory, and configure ICU. (See <a href="#HowToConfigureICU">configuration 1428 note</a> for details). Note that --with-data-packaging=archive and setting the --prefix are recommended, building in default (dll) mode is currently not supported. 1429 <pre><samp>cd icu/source 1430./runConfigureICU IBMi --prefix=<i>/path/to/somewhere</i> --with-data-packaging=archive</samp></pre> 1431</li> 1432 1433 <li>Build ICU. <i>(Note: Do not use the -j option)</i> <pre><samp>gmake</samp></pre></li> 1434 1435 <li>Test ICU. <pre><samp>gmake check</samp></pre> 1436 (The <tt> QIBM_MULTI_THREADED=Y</tt> flag will be automatically applied to intltest - 1437 you can look at the <a href= 1438 "https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzahw/rzahwceeco.htm"> 1439 iSeries Information Center</a> for more details regarding the running of multiple threads 1440 on IBM i.)</li> 1441 </ol> 1442 1443 <!-- cross --> 1444 <h3><a name="HowToCrossCompileICU" href="#HowToCrossCompileICU" id="HowToCrossCompileICU">How To Cross Compile ICU</a></h3> 1445 <p>This section will explain how to build ICU on one platform, but to produce binaries intended to run on another. This is commonly known as a cross compile.</p> 1446 <p>Normally, in the course of a build, ICU needs to run the tools that it builds in order to generate and package data and test-data.In a cross compilation setting, ICU is built on a different system from that which it eventually runs on. An example might be, if you are building for a small/headless system (such as an embedded device), or a system where you can't easily run the ICU command line tools (any non-UNIX-like system).</p> 1447 <p>To reduce confusion, we will here refer to the "A" and the "B" system.System "A" is the actual system we will be running on- the only requirements on it is are it is able to build ICU from the command line targetting itself (with configure or runConfigureICU), and secondly, that it also contain the correct toolchain for compiling and linking for the resultant platform, referred to as the "B" system.</p> 1448 <p>The autoconf docs use the term "build" for A, and "host" for B. More details at: <a href="http://www.gnu.org/software/autoconf/manual/html_node/Specifying-Names.html#Specifying-Names">http://www.gnu.org/software/autoconf/manual/html_node/Specifying-Names.html</a></p> 1449 <p>Three initially-empty directories will be used in this example:</p> 1450 <table summary="Three directories used in this example" class="docTable"> 1451 <tr> 1452 <th align="left">/icu</th><td>a copy of the ICU source</td> 1453 </tr> 1454 <tr> 1455 <th align="left">/buildA</th><td>an empty directory, it will contain ICU built for A<br />(MacOSX in this case)</td> 1456 </tr> 1457 <tr> 1458 <th align="left">/buildB</th><td>an empty directory, it will contain ICU built for B<br />(HaikuOS in this case)</td> 1459 </tr> 1460 </table> 1461 1462 <ol> 1463 <li>Check out or unpack the ICU source code into the /icu directory.You will have the directories /icu/source, etc.</li> 1464 <li>Build ICU in /buildA normally (using runConfigureICU or configure): 1465<pre class="samp">cd /buildA 1466sh /icu/source/runConfigureICU <strong>MacOSX</strong> 1467gnumake 1468</pre> 1469 </li> 1470 <li>Set PATH or other variables as needed, such as CPPFLAGS.</li> 1471 <li>Build ICU in /buildB<br /> 1472 <p class="note">"<code>--with-cross-build</code>" takes an absolute path.</p> 1473<pre class="samp">cd /buildB 1474sh /icu/source/configure --host=<strong>i586-pc-haiku</strong> --with-cross-build=<strong>/buildA</strong> 1475gnumake</pre> 1476 </li> 1477 <li>Tests and testdata can be built with "gnumake tests".</li> 1478 </ol> 1479 <!-- end cross --> 1480 1481 <!-- end build environment --> 1482 1483 <h2><a name="HowToPackage" href="#HowToPackage" id="HowToPackage">How To 1484 Package ICU</a></h2> 1485 1486 <p>There are many ways that a person can package ICU with their software 1487 products. Usually only the libraries need to be considered for packaging.</p> 1488 1489 <p>On UNIX, you should use "<tt>gmake install</tt>" to make it easier to 1490 develop and package ICU. The bin, lib and include directories are needed to 1491 develop applications that use ICU. These directories will be created relative 1492 to the "<tt>--prefix=</tt><i>dir</i>" configure option (See the <a href= 1493 "#HowToBuildUNIX">UNIX build instructions</a>). When ICU is built on Windows, 1494 a similar directory structure is built.</p> 1495 1496 <p>When changes have been made to the standard ICU distribution, it is 1497 recommended that at least one of the following guidelines be followed for 1498 special packaging.</p> 1499 1500 <ol> 1501 <li>Add a suffix name to the library names. This can be done with the 1502 --with-library-suffix configure option.</li> 1503 1504 <li>The installation script should install the ICU libraries into the 1505 application's directory.</li> 1506 </ol> 1507 1508 <p>Following these guidelines prevents other applications that use a standard 1509 ICU distribution from conflicting with any libraries that you need. On 1510 operating systems that do not have a standard C++ ABI (name mangling) for 1511 compilers, it is recommended to do this special packaging anyway. More 1512 details on customizing ICU are available in the <a href= 1513 "http://userguide.icu-project.org/">User's Guide</a>. The <a href= 1514 "#SourceCode">ICU Source Code Organization</a> section of this readme.html 1515 gives a more complete description of the libraries.</p> 1516 1517 <table class="docTable" summary= 1518 "ICU has several libraries for you to use."> 1519 <caption> 1520 Here is an example of libraries that are frequently packaged. 1521 </caption> 1522 1523 <tr> 1524 <th scope="col">Library Name</th> 1525 1526 <th scope="col">Windows Filename</th> 1527 1528 <th scope="col">Linux Filename</th> 1529 1530 <th scope="col">Comment</th> 1531 </tr> 1532 1533 <tr> 1534 <td>Data Library</td> 1535 1536 <td>icudt<i>XY</i>l.dll</td> 1537 1538 <td>libicudata.so.<i>XY</i>.<i>Z</i></td> 1539 1540 <td>Data required by the Common and I18n libraries. There are many ways 1541 to package and <a href= 1542 "http://userguide.icu-project.org/icudata">customize this 1543 data</a>, but by default this is all you need.</td> 1544 </tr> 1545 1546 <tr> 1547 <td>Common Library</td> 1548 1549 <td>icuuc<i>XY</i>.dll</td> 1550 1551 <td>libicuuc.so.<i>XY</i>.<i>Z</i></td> 1552 1553 <td>Base library required by all other ICU libraries.</td> 1554 </tr> 1555 1556 <tr> 1557 <td>Internationalization (i18n) Library</td> 1558 1559 <td>icuin<i>XY</i>.dll</td> 1560 1561 <td>libicui18n.so.<i>XY</i>.<i>Z</i></td> 1562 1563 <td>A library that contains many locale based internationalization (i18n) 1564 functions.</td> 1565 </tr> 1566 1567 <tr> 1568 <td>Layout Extensions Engine</td> 1569 1570 <td>iculx<i>XY</i>.dll</td> 1571 1572 <td>libiculx.so.<i>XY</i>.<i>Z</i></td> 1573 1574 <td>An optional engine for doing paragraph layout that uses 1575 parts of ICU. 1576 HarfBuzz is required.</td> 1577 </tr> 1578 1579 <tr> 1580 <td>ICU I/O (Unicode stdio) Library</td> 1581 1582 <td>icuio<i>XY</i>.dll</td> 1583 1584 <td>libicuio.so.<i>XY</i>.<i>Z</i></td> 1585 1586 <td>An optional library that provides a stdio like API with Unicode 1587 support.</td> 1588 </tr> 1589 1590 <tr> 1591 <td>Tool Utility Library</td> 1592 1593 <td>icutu<i>XY</i>.dll</td> 1594 1595 <td>libicutu.so.<i>XY</i>.<i>Z</i></td> 1596 1597 <td>An internal library that contains internal APIs that are only used by 1598 ICU's tools. If you do not use ICU's tools, you do not need this 1599 library.</td> 1600 </tr> 1601 </table> 1602 1603 <p>Normally only the above ICU libraries need to be considered for packaging. 1604 The versionless symbolic links to these libraries are only needed for easier 1605 development. The <i>X</i>, <i>Y</i> and <i>Z</i> parts of the name are the 1606 version numbers of ICU. For example, ICU 2.0.2 would have the name 1607 libicuuc.so.20.2 for the common library. The exact format of the library 1608 names can vary between platforms due to how each platform can handles library 1609 versioning.</p> 1610 1611 <h2><a name="ImportantNotes" href="#ImportantNotes" id= 1612 "ImportantNotes">Important Notes About Using ICU</a></h2> 1613 1614 <h3><a name="ImportantNotesMultithreaded" href="#ImportantNotesMultithreaded" 1615 id="ImportantNotesMultithreaded">Using ICU in a Multithreaded 1616 Environment</a></h3> 1617 1618 <p>Some versions of ICU require calling the <code>u_init()</code> function 1619 from <code>uclean.h</code> to ensure that ICU is initialized properly. In 1620 those ICU versions, <code>u_init()</code> must be called before ICU is used 1621 from multiple threads. There is no harm in calling <code>u_init()</code> in a 1622 single-threaded application, on a single-CPU machine, or in other cases where 1623 <code>u_init()</code> is not required.</p> 1624 1625 <p>In addition to ensuring thread safety, <code>u_init()</code> also attempts 1626 to load at least one ICU data file. Assuming that all data files are packaged 1627 together (or are in the same folder in files mode), a failure code from 1628 <code>u_init()</code> usually means that the data cannot be found. In this 1629 case, the data may not be installed properly, or the application may have 1630 failed to call <code>udata_setCommonData()</code> or 1631 <code>u_setDataDirectory()</code> which specify to ICU where it can find its 1632 data.</p> 1633 1634 <p>Since <code>u_init()</code> will load only one or two data files, it 1635 cannot guarantee that all of the data that an application needs is available. 1636 It cannot check for all data files because the set of files is customizable, 1637 and some ICU services work without loading any data at all. An application 1638 should always check for error codes when opening ICU service objects (using 1639 <code>ucnv_open()</code>, <code>ucol_open()</code>, C++ constructors, 1640 etc.).</p> 1641 1642 <h4>ICU 3.4 and later</h4> 1643 1644 <p>ICU 3.4 self-initializes properly for multi-threaded use. It achieves this 1645 without performance penalty by hardcoding the core Unicode properties data, 1646 at the cost of some flexibility. (For details see Jitterbug 4497.)</p> 1647 1648 <p><code>u_init()</code> can be used to check for data loading. It tries to 1649 load the converter alias table (<code>cnvalias.icu</code>).</p> 1650 1651 <h4>ICU 2.6..3.2</h4> 1652 1653 <p>These ICU versions require a call to <code>u_init()</code> before 1654 multi-threaded use. The services that are directly affected are those that 1655 don't have a service object and need to be fast: normalization and character 1656 properties.</p> 1657 1658 <p><code>u_init()</code> loads and initializes the data files for 1659 normalization and character properties (<code>unorm.icu</code> and 1660 <code>uprops.icu</code>) and can therefore also be used to check for data 1661 loading.</p> 1662 1663 <h4>ICU 2.4 and earlier</h4> 1664 1665 <p>ICU 2.4 and earlier versions were not prepared for multithreaded use on 1666 multi-CPU platforms where the CPUs implement weak memory coherency. These 1667 CPUs include: Power4, Power5, Alpha, Itanium. <code>u_init()</code> was not 1668 defined yet.</p> 1669 1670 <h4><a name="ImportantNotesHPUX" href="#ImportantNotesHPUX" id= 1671 "ImportantNotesHPUX">Using ICU in a Multithreaded Environment on 1672 HP-UX</a></h4> 1673 1674 <p>When ICU is built with aCC on HP-UX, the <a 1675 href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=eb08b3f1eee02110b3f1eee02110275d6e10RCRD">-AA</a> 1676 compiler flag is used. It is required in order to use the latest 1677 <iostream> API in a thread safe manner. This compiler flag affects the 1678 version of the C++ library being used. Your applications will also need to 1679 be compiled with -AA in order to use ICU.</p> 1680 1681 <h4><a name="ImportantNotesSolaris" href="#ImportantNotesSolaris" id= 1682 "ImportantNotesSolaris">Using ICU in a Multithreaded Environment on 1683 Solaris</a></h4> 1684 1685 <h5>Linking on Solaris</h5> 1686 1687 <p>In order to avoid synchronization and threading issues, developers are 1688 <strong>suggested</strong> to strictly follow the compiling and linking 1689 guidelines for multithreaded applications, specified in the following 1690 SUn Solaris document available from Oracle. Most notably, pay strict attention to the 1691 following statements from Sun:</p> 1692 1693 <blockquote> 1694 <p>To use libthread, specify -lthread before -lc on the ld command line, or 1695 last on the cc command line.</p> 1696 1697 <p>To use libpthread, specify -lpthread before -lc on the ld command line, 1698 or last on the cc command line.</p> 1699 </blockquote> 1700 1701 <p>Failure to do this may cause spurious lock conflicts, recursive mutex 1702 failure, and deadlock.</p> 1703 1704 <p>Source: "<i>Multithreaded Programming Guide, Compiling and 1705 Debugging</i>", Sun Microsystems, 2002 <br /> 1706 <a href= 1707 "https://docs.oracle.com/cd/E19683-01/806-6867/compile-74765/index.html">https://docs.oracle.com/cd/E19683-01/806-6867/compile-74765/index.html</a></p> 1708 1709 <p>Note, a version of that chapter from a 2008 document update covering both Solaris 9 1710 and Solaris 10 is available here:<br /> 1711 <a href= 1712 "http://docs.oracle.com/cd/E19253-01/816-5137/compile-94179/index.html">http://docs.oracle.com/cd/E19253-01/816-5137/compile-94179/index.html</a></p> 1713 1714 <h3><a name="ImportantNotesWindows" href="#ImportantNotesWindows" id= 1715 "ImportantNotesWindows">Windows Platform</a></h3> 1716 1717 <p>If you are building on the Windows platform, it is important that you 1718 understand a few of the following build details.</p> 1719 1720 <h4>DLL directories and the PATH setting</h4> 1721 1722 <p>As delivered, the International Components for Unicode build as several 1723 DLLs, which are placed in the "<i><ICU></i>\bin64" directory. You must 1724 add this directory to the PATH environment variable in your system, or any 1725 executables you build will not be able to access International Components for 1726 Unicode libraries. Alternatively, you can copy the DLL files into a directory 1727 already in your PATH, but we do not recommend this. You can wind up with 1728 multiple copies of the DLL and wind up using the wrong one.</p> 1729 1730 <h4><a name="ImportantNotesWindowsPath" id= 1731 "ImportantNotesWindowsPath">Changing your PATH</a></h4> 1732 1733 <p><strong>Windows 2000/XP and above</strong>: Use the System Icon in the Control 1734 Panel. Pick the "Advanced" tab. Select the "Environment Variables..." 1735 button. Select the variable PATH in the lower box, and select the lower 1736 "Edit..." button. In the "Variable Value" box, append the string 1737 ";<i><ICU></i>\bin64" to the end of the path string. If there is 1738 nothing there, just type in "<i><ICU></i>\bin64". Click the Set button, 1739 then the OK button.</p> 1740 1741 <p>Note: When packaging a Windows application for distribution and 1742 installation on user systems, copies of the ICU DLLs should be included with 1743 the application, and installed for exclusive use by the application. This is 1744 the only way to insure that your application is running with the same version 1745 of ICU, built with exactly the same options, that you developed and tested 1746 with. Refer to Microsoft's guidelines on the usage of DLLs, or search for the 1747 phrase "DLL hell" on <a href= 1748 "http://msdn.microsoft.com/">msdn.microsoft.com</a>.</p> 1749 1750 <h3><a name="ImportantNotesUNIX" href="#ImportantNotesUNIX" id= 1751 "ImportantNotesUNIX">UNIX Type Platform</a></h3> 1752 1753 <p>If you are building on a UNIX platform, and if you are installing ICU in a 1754 non-standard location, you may need to add the location of your ICU libraries 1755 to your <strong>LD_LIBRARY_PATH</strong> or <strong>LIBPATH</strong> 1756 environment variable (or the equivalent runtime library path environment 1757 variable for your system). The ICU libraries may not link or load properly 1758 without doing this.</p> 1759 1760 <p>Note that if you do not want to have to set this variable, you may instead 1761 use the --enable-rpath option at configuration time. This option will 1762 instruct the linker to always look for the libraries where they are 1763 installed. You will need to use the appropriate linker options when linking 1764 your own applications and libraries against ICU, too. Please refer to your 1765 system's linker manual for information about runtime paths. The use of rpath 1766 also means that when building a new version of ICU you should not have an 1767 older version installed in the same place as the new version's installation 1768 directory, as the older libraries will used during the build, instead of the 1769 new ones, likely leading to an incorrectly build ICU. This is the proper 1770 behavior of rpath.</p> 1771 1772 <h2><a name="PlatformDependencies" href="#PlatformDependencies" id= 1773 "PlatformDependencies">Platform Dependencies</a></h2> 1774 1775 <h3><a name="PlatformDependenciesNew" href="#PlatformDependenciesNew" id= 1776 "PlatformDependenciesNew">Porting To A New Platform</a></h3> 1777 1778 <p>If you are using ICU's Makefiles to build ICU on a new platform, there are 1779 a few places where you will need to add or modify some files. If you need 1780 more help, you can always ask the <a href= 1781 "http://site.icu-project.org/contacts">icu-support mailing list</a>. Once 1782 you have finished porting ICU to a new platform, it is recommended that you 1783 contribute your changes back to ICU via the icu-support mailing list. This 1784 will make it easier for everyone to benefit from your work.</p> 1785 1786 <h4>Data For a New Platform</h4> 1787 1788 <p>For some people, it may not be necessary for completely build ICU. Most of 1789 the makefiles and build targets are for tools that are used for building 1790 ICU's data, and an application's data (when an application uses ICU resource 1791 bundles for its data).</p> 1792 1793 <p>Data files can be built on a different platform when both platforms share 1794 the same endianness and the same charset family. This assertion does not 1795 include platform dependent DLLs/shared/static libraries. For details see the 1796 User Guide <a href="http://userguide.icu-project.org/icudata">ICU 1797 Data</a> chapter.</p> 1798 1799 <p>ICU 3.6 removes the requirement that ICU be completely built in the native 1800 operating environment. It adds the icupkg tool which can be run on any 1801 platform to turn binary ICU data files from any one of the three formats into 1802 any one of the other data formats. This allows a application to use ICU data 1803 built anywhere to be used for any other target platform.</p> 1804 1805 <p><strong>WARNING!</strong> Building ICU without running the tests is not 1806 recommended. The tests verify that ICU is safe to use. It is recommended that 1807 you try to completely port and test ICU before using the libraries for your 1808 own application.</p> 1809 1810 <h4>Adapting Makefiles For a New Platform</h4> 1811 1812 <p>Try to follow the build steps from the <a href="#HowToBuildUNIX">UNIX</a> 1813 build instructions. If the configure script fails, then you will need to 1814 modify some files. Here are the usual steps for porting to a new 1815 platform:<br /> 1816 </p> 1817 1818 <ol> 1819 <li>Create an mh file in icu/source/config/. You can use mh-linux or a 1820 similar mh file as your base configuration.</li> 1821 1822 <li>Modify icu/source/aclocal.m4 to recognize your platform's mh file.</li> 1823 1824 <li>Modify icu/source/configure.in to properly set your <b>platform</b> C 1825 Macro define.</li> 1826 1827 <li>Run <a href="http://www.gnu.org/software/autoconf/">autoconf</a> in 1828 icu/source/ without any options. The autoconf tool is standard on most 1829 Linux systems.</li> 1830 1831 <li>If you have any optimization options that you want to normally use, you 1832 can modify icu/source/runConfigureICU to specify those options for your 1833 platform.</li> 1834 1835 <li>Build and test ICU on your platform. It is very important that you run 1836 the tests. If you don't run the tests, there is no guarentee that you have 1837 properly ported ICU.</li> 1838 </ol> 1839 1840 <h3><a name="PlatformDependenciesImpl" href="#PlatformDependenciesImpl" id= 1841 "PlatformDependenciesImpl">Platform Dependent Implementations</a></h3> 1842 1843 <p>The platform dependencies have been mostly isolated into the following 1844 files in the common library. This information can be useful if you are 1845 porting ICU to a new platform.</p> 1846 1847 <ul> 1848 <li> 1849 <strong>unicode/platform.h.in</strong> (autoconf'ed platforms)<br /> 1850 <strong>unicode/p<i>XXXX</i>.h</strong> (others: pwin32.h, ppalmos.h, 1851 ..): Platform-dependent typedefs and defines:<br /> 1852 <br /> 1853 1854 1855 <ul> 1856 <li>Generic types like UBool, int8_t, int16_t, int32_t, int64_t, 1857 uint64_t etc.</li> 1858 1859 <li>U_EXPORT and U_IMPORT for specifying dynamic library import and 1860 export</li> 1861 1862 <li>String handling support for the char16_t and wchar_t types.</li> 1863 </ul> 1864 <br /> 1865 </li> 1866 1867 <li> 1868 <strong>unicode/putil.h, putil.c</strong>: platform-dependent 1869 implementations of various functions that are platform dependent:<br /> 1870 <br /> 1871 1872 1873 <ul> 1874 <li>uprv_isNaN, uprv_isInfinite, uprv_getNaN and uprv_getInfinity for 1875 handling special floating point values.</li> 1876 1877 <li>uprv_tzset, uprv_timezone, uprv_tzname and time for getting 1878 platform specific time and time zone information.</li> 1879 1880 <li>u_getDataDirectory for getting the default data directory.</li> 1881 1882 <li>uprv_getDefaultLocaleID for getting the default locale 1883 setting.</li> 1884 1885 <li>uprv_getDefaultCodepage for getting the default codepage 1886 encoding.</li> 1887 </ul> 1888 <br /> 1889 </li> 1890 1891 <li> 1892 <strong>umutex.h, umutex.c</strong>: Code for doing synchronization in 1893 multithreaded applications. If you wish to use International Components 1894 for Unicode in a multithreaded application, you must provide a 1895 synchronization primitive that the classes can use to protect their 1896 global data against simultaneous modifications. We already supply working 1897 implementations for many platforms that ICU builds on.<br /> 1898 <br /> 1899 </li> 1900 1901 <li><strong>umapfile.h, umapfile.c</strong>: functions for mapping or 1902 otherwise reading or loading files into memory. All access by ICU to data 1903 from files makes use of these functions.<br /> 1904 <br /> 1905 </li> 1906 1907 <li>Using platform specific #ifdef macros are highly discouraged outside of 1908 the scope of these files. When the source code gets updated in the future, 1909 these #ifdef's can cause testing problems for your platform.</li> 1910 </ul> 1911 <hr /> 1912 <p> Copyright © 2016 and later: Unicode, Inc. and others. License & terms of use: 1913 <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/> 1914 Copyright © 1997-2016 International Business Machines Corporation and others. 1915 All Rights Reserved.</p> 1916 </body> 1917</html> 1918