Build libicu for iphone

从http://site.icu-project.org/ 下载icu,解压到icu目录。

在当前目录创建空目录hostbuild,进入hostbuild目录,运行sh ../icu/source/runConfigureICU MacOSX.

mkdir hostbuild

cd hostbuild 

sh ../icu/source/runConfigureICU MacOSX

gnumake


然后设置PATH,CFLAGS,CPPFLAGS等环境变量。

DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
SDKROOT=$DEVROOT/SDKs/iPhoneOS4.3.sdk
SYSROOT=$SDKROOT
ICU_MYSRC=/Users/.../icu

export CXXPP=
export CXXPPFLAGS=
export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/llvm-gcc-4.2/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/include/ -I$SDKROOT/usr/include/c++/4.2.1/armv7-apple-darwin10/ -I./include/ -I$ICU_MYSRC/source/common/ -I$ICU_MYSRC/source/tools/tzcode/ -miphoneos-version-min=2.2"
export CFLAGS="$CPPFLAGS -pipe -no-cpp-precomp -isysroot $SDKROOT"
export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
export CXXFLAGS="$CFLAGS" 
export CC="$DEVROOT/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2"
export CXX="$DEVROOT/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-g++-4.2"
export LDFLAGS="-L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip -miphoneos-version-min=2.0"

sh ../icu/source/configure --host=arm-apple-darwin --enable-static --disable-shared -with-cross-build=.../hostbuild
-with-cross-build要使用绝对路径,用的时候替换一下。

创建cross compile目录iphonebuild。

mkdir iphonebuild

cd iphonebuild

sh ../icu/source/configure --host=arm-apple-darwin --enable-static --disable-shared -with-cross-build=.../hostbuild

gmake



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值