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