在 OSX 上为 ICU 核心生成或查找 C 头文件

Jer*_*oen 5 c macos icu osx-mavericks

不幸的是,苹果没有libicucore在 OSX 上包含头文件。有什么办法可以使用这个库吗?我只需要一些简单的功能,而 ICU 太大而无法与我的应用程序捆绑在一起。它看起来像最近的 ICU 版本 53.1.0:

jeroen$ otool -L /usr/lib/libicucore.dylib
libicucore.dylib:
    /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 53.1.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
Run Code Online (Sandbox Code Playgroud)

使事情复杂化的是,我很难找出ICU的核心目标中包含的内容。我可以使用nm手动检查库中是否存在特定符号:

jeroen$ nm /usr/lib/libicucore.dylib | grep ToUpper
00000000000b74c9 T _u_strToUpper
000000000006ff70 T _ucasemap_utf8ToUpper
Run Code Online (Sandbox Code Playgroud)

现在我可以手动u_strToUpper从 ICU 的 53.1.0 版本中获取头文件,但这是很多工作。是否有更好的方法在 OSX 上查找或生成 ICU 核心 53.1.0 的标头?

Jer*_*oen 2

看起来我最好的选择是从苹果网站获取标题。该存储库还包括 makefile,libicucore.dylib用于--with-data-packaging=archive将 ICU 数据表放入独立文件中/usr/share/icu/icudt51l.dat