Cross Compile ICU 51.2

The IBM ICU library can not simply invoke configure to finish the cross-compilation, we should do some steps to process it.

We assume you have already downloaded and unpacked ICU 51.2 to "/opt/icu"

Local Compilation

Compile for current os.

ICU need some stuffs from ICU which compiled for current operatoin system, so we satisfy it's requirement.

First, we make an icu source copy :

cp -rfd /opt/icu /opt/icu_prebuild

Secondary, we compile it for current opearting system :

cd /opt/icu_prebuild/source
./configure
make

Cross Compilation

We could now cross compile our ICU library now:

export TOOLCHAIN_TARGET_SYSTEM=arm-none-linux-gnueabi
export TOOLCHAIN_INSTALL_DIRECTORY=/opt/toolchain

cd /opt/icu/source
./configure CC=$TOOLCHAIN_TARGET_SYSTEM-gcc CXX=$TOOLCHAIN_TARGET_SYSTEM-g++ CPP=$TOOLCHAIN_TARGET_SYSTEM-cpp --host=$TOOLCHAIN_TARGET_SYSTEM --prefix=$TOOLCHAIN_INSTALL_DIRECTORY --enable-shared=yes --enable-tests=no --enable-samples=no --with-cross-build=/opt/icu_prebuild/source
make

NOTICE

Do not try to compile the static version of ICU, seems that would cause some errors.

Comments !