如何使用ICU编译sqlite? [英] How to compile sqlite with ICU?

查看:415
本文介绍了如何使用ICU编译sqlite?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 http://www.sqlite.org/sqlite-下载了sqlite autoconf-3070701.tar.gz

如何使用icu编译sqlite?

How can I compile sqlite with icu ?

推荐答案

1)您可以将其编译为SQLite的动态扩展 引用 http://www.sqlite.org/cvstrac /fileview?f=sqlite/ext/icu/README.txt

1) You can compile it as dynamic extension of SQLite Citing http://www.sqlite.org/cvstrac/fileview?f=sqlite/ext/icu/README.txt

编译和使用ICU扩展的最简单方法是构建 并将其用作可动态加载的SQLite扩展.去做这个 在* nix上使用gcc:

The easiest way to compile and use the ICU extension is to build and use it as a dynamically loadable SQLite extension. To do this using gcc on *nix:

gcc -shared icu.c `icu-config  --cppflags --ldflags` -o libSqliteIcu.so

您可能需要添加"-I"标志,以便gcc可以找到sqlite3ext.h 和sqlite3.h.生成的共享库libSqliteIcu.so可能是 以与其他任何可动态加载的方式相同的方式加载到sqlite中 扩展名.

You may need to add "-I" flags so that gcc can find sqlite3ext.h and sqlite3.h. The resulting shared lib, libSqliteIcu.so, may be loaded into sqlite in the same way as any other dynamically loadable extension.

(在SQLite提示符下加载为.load libSqliteIcu.so)

(loading is .load libSqliteIcu.so in SQLite prompt)

2)您可以在启用ICU的情况下编译SQLite.根据 http://www.sqlite.org/compile.html 您应该定义宏SQLITE_ENABLE_ICU:

2) You can compile SQLite with ICU enabled. According to http://www.sqlite.org/compile.html you should define macro SQLITE_ENABLE_ICU:

在CFLAGS变量中添加-DSQLITE_ENABLE_ICU或在某些配置文件中添加#define SQLITE_ENABLE_ICU.

Add -DSQLITE_ENABLE_ICU to the CFLAGS variable or add #define SQLITE_ENABLE_ICU in some config file.

好的,这里有一些标准文档中未描述的内容.这是在启用ICU的情况下调用configure的示例:

Okay, there is something here not described in standard documentation. Here is an example of calling configure with ICU enabled:

 CFLAGS='-O3 -DSQLITE_ENABLE_ICU' CPPFLAGS=`icu-config --cppflags` LDFLAGS=`icu-config --ldflags` ./configure

您还应该安装icu-config程序(来自libiculibicu-dev软件包)

You also should have icu-config program installed (it is from libicu or libicu-dev package)

这篇关于如何使用ICU编译sqlite?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆