Difference between revisions of "ICU"

From Apache OpenOffice Wiki
Jump to: navigation, search
(point out that icu is indeed a module directory)
m (upgrade to 3.6 done)
Line 13: Line 13:
 
upstream versions. Some patches are only relevant in the OOo environment and
 
upstream versions. Some patches are only relevant in the OOo environment and
 
won't make it upstream. ICU 3.6 beta includes most of the patches OOo applied.
 
won't make it upstream. ICU 3.6 beta includes most of the patches OOo applied.
Upgrade to ICU 3.6 is ongoing in [[CWS]]
+
Upgrade to ICU 3.6 was done in [[CWS]]
 
''[http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Id=3595&Path=SRC680%2Ficuupgrade icuupgrade]''
 
''[http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Id=3595&Path=SRC680%2Ficuupgrade icuupgrade]''
  

Revision as of 10:24, 9 January 2008

The International Components for Unicode or ICU is an external library originally developed by IBM, available at http://icu.sourceforge.net/. OOo uses the C libraries ICU4C (there is also a set of Java libraries ICU4J available) for glyph layout in CTL languages, Unicode algorithms like collation, break iterators for word boundaries, and calendar systems.

ICU is located in module icu of the source code directories in the OOo build tree.

OOo up to version 2.0.4 uses ICU 2.6, which is quite old by now and is heavily patched to suit OOo's needs. Most patches are available later in one of the upstream versions. Some patches are only relevant in the OOo environment and won't make it upstream. ICU 3.6 beta includes most of the patches OOo applied. Upgrade to ICU 3.6 was done in CWS icuupgrade

Most functionality is encapsulated in the i18npool module and should be accessed using the ::com::sun::star::i18n::* UNO API only, just little source code uses ICU functionality directly for glyph layout, where necessary. Please do not add further dependencies, if possible. As of CWS icuupgrade resynced to SRC680_m181 the dependent source files that have to be touched and built when upgrading to a newer ICU version, apart from the entire module module i18npool, were:

Note the two NOTEs interspersed, or Windows won't build!

# 2006-10-30T12:19+0100 as of CWS 'icuupgrade' resynced to SRC680_m187
#
# Dependencies on ICU.
# Plus, of course, the entire module i18npool.
# The scp2 files depend on icuversion.mk.
#
# Module 'proximity' may use ICU if enabled PROX_PUNI_USE_ICU or REQUIRE_ICU_LIBRARY in
# proximity/inc/punicfg.h
# or (makefile) environment, which currently is not the case.
#
# Touch these files, assuming this list is in ~/devbase/icu/these_use_icu.txt:
# touch `grep -v '^#' ~/devbase/icu/these_use_icu.txt | sed -e 's/\([^:]*\):.*/\1/'`
#
binfilter/bf_svx/source/editeng/svx_impedit2.cxx:149:#include <unicode/ubidi.h>
binfilter/bf_svx/source/outliner/svx_outliner.cxx:107:#include <unicode/ubidi.h>
binfilter/bf_sw/source/core/text/sw_frmcrsr.cxx:78:#include <unicode/ubidi.h>
binfilter/bf_sw/source/core/text/sw_porlay.cxx:94:#include <unicode/ubidi.h>
binfilter/bf_sw/source/filter/ww8/sw_wrtw8nds.cxx:60:#include <unicode/ubidi.h>
forms/source/xforms/warnings_guard_unicode_regex.h:51:#include <unicode/regex.h>
linguistic/source/hhconvdic.cxx:40:#include <external/unicode/uscript.h>
svtools/source/edit/texteng.cxx:99:#include <unicode/ubidi.h>
svx/source/editeng/impedit2.cxx:118:#include <unicode/ubidi.h>
svx/source/outliner/outliner.cxx:110:#include <unicode/ubidi.h>
sw/source/core/text/frmcrsr.cxx:74:#include <unicode/ubidi.h>
sw/source/core/text/porfld.cxx:113:#include <unicode/ubidi.h>
sw/source/core/text/porlay.cxx:113:#include <unicode/ubidi.h>
sw/source/core/text/ScriptInfo.cxx:129:#include <unicode/ubidi.h>
sw/source/filter/ww8/writerwordglue.cxx:55:#include <unicode/ubidi.h>          //ubidi_getLogicalRun
vcl/source/gdi/sallayout.cxx:77:#include <unicode/ubidi.h>
vcl/source/gdi/sallayout.cxx:78:#include <unicode/uchar.h>
vcl/source/glyphs/gcach_layout.cxx:179:#include <layout/LayoutEngine.h>
vcl/source/glyphs/gcach_layout.cxx:180:#include <layout/LEFontInstance.h>
vcl/source/glyphs/gcach_layout.cxx:181:#include <layout/LEScripts.h>
vcl/source/glyphs/gcach_layout.cxx:188:#include <unicode/uscript.h>
vcl/source/glyphs/gcach_layout.cxx:189:#include <unicode/ubidi.h>
#
#proximity.lnk/source/proximity/icudbg.c:33:#include "unicode/ustring.h"
#proximity.lnk/source/proximity/icudbg.c:34:#include "unicode/ucnv.h"
#proximity.lnk/source/proximity/icudbg.c:35:#include "unicode/unorm.h"
#proximity.lnk/source/proximity/icudbg.c:36:#include "unicode/uchar.h"
#proximity.lnk/source/proximity/icufun.c:29:#include <unicode/ustring.h>
#proximity.lnk/source/proximity/icufun.c:30:#include <unicode/ucnv.h>
#proximity.lnk/source/proximity/icufun.c:31:#include <unicode/unorm.h>
#
#
# Modules linking against ICU[A-Z]*LIB
#
# NOTE: under Windows you'll have to remove those painful *.def files in these
# modules, or you will get unresolved externals! e.g.
# rm {linguistic,svx,sw,vcl,forms,i18npool,binfilter,svtools}/wntmsci10*/misc/*.def
#
# NOTE: due to the nature of how Windows searches for DLLs, executable's path
# first, if upgrading to a newer ICU version or building touched files when
# having resynced the CWS to a newer milestone it is necessary to
# copy solver\wntmsci10.pro\bin.m187\regcomp.exe binfilter\wntmsci10.pro\bin
# or otherwise the build will break in binfilter/util !
# Replace m187 with the actual $UPDMINOR of course.
#
#./binfilter/bf_svx/util/makefile.mk:            $(ICUUCLIB)\
#./binfilter/bf_sw/util/makefile.mk:    $(ICUUCLIB)
#./forms/util/makefile.mk:        $(ICUINLIB)
#./forms/util/makefile.mk:        $(ICUUCLIB) \
#./i18npool/source/collator/makefile.mk:		$(ICUINLIB) \
#./i18npool/source/collator/makefile.mk:		$(ICUUCLIB)
#./i18npool/source/indexentry/makefile.mk:        $(ICUINLIB) \
#./i18npool/source/indexentry/makefile.mk:        $(ICUUCLIB)
#./i18npool/util/makefile.mk:		$(ICUINLIB) \
#./i18npool/util/makefile.mk:		$(ICUUCLIB)
#./linguistic/source/makefile.mk:        $(ICUUCLIB)
#./svtools/util/makefile.mk:		$(ICUUCLIB)		\
#./svx/util/makefile.mk:            $(ICUUCLIB)
#./sw/util/makefile.mk:    $(ICUUCLIB) \
#./vcl/util/makefile.mk:            $(ICULELIB)			\
#./vcl/util/makefile.mk:            $(ICUUCLIB)			\

In case you missed it from the comments above, repeating the commands here to touch and remove files:

# Touch these files, assuming the above list is in ~/devbase/icu/these_use_icu.txt:
touch `grep -v '^#' ~/devbase/icu/these_use_icu.txt | sed -e 's/\([^:]*\):.*/\1/'`
rm {linguistic,svx,sw,vcl,forms,i18npool,binfilter,svtools}/wntmsci10*/misc/*.def

Repeating a necessary step for Windows, without this build will fail in module binfilter:

# NOTE: due to the nature of how Windows searches for DLLs, executable's path
# first, if upgrading to a newer ICU version or building touched files when
# having resynced the CWS to a newer milestone it is necessary to
# copy solver\wntmsci10.pro\bin.m181\regcomp.exe binfilter\wntmsci10.pro\bin
# or otherwise the build will break in binfilter/util !
# Replace m181 with the actual $UPDMINOR of course.

The above lists may be obtained by invoking the following script in the $SRC_ROOT directory:

# Look for ICU...LIB in makefiles to get modules
# Note that the Solaris grep doesn't know option -H, use GNU grep!
find . -name makefile.mk -exec grep -H 'ICU[A-Z]*LIB' {} \; | sort -u

# Using a global GNU ID-utils database, look for include unicode/*, layout/*
lid --separator newline --result=grep --regexp 'unicode|layout' | egrep -v '(/build/icu/|com/sun/star/)' | egrep 'include.*[<"/](unicode|layout)/' | sort -u

# The same command without saving output to an interim file and applying the
# grep/sed commands from these_use_icu.txt, here used with the echo command,
# replace with anything you like, e.g. 'ls -l' or 'touch'.
#echo `lid --separator newline --result=grep --regexp 'unicode|layout' | egrep -v '(/build/icu/|com/sun/star/)' | egrep 'include.*[<"/](unicode|layout)/' | sort -u | grep -v '^#' | sed -e 's/\([^:]*\):.*/\1/'`
Personal tools