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