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