Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite on rtthread #203

Closed
wants to merge 19 commits into from
Closed

Sqlite on rtthread #203

wants to merge 19 commits into from

Conversation

geniusgogo
Copy link
Contributor

Port SQLite version 3.8.1 to rt-thread
components\external\sqlite
components\external\SQLite-3.8.1
detailed description on the two directory README
about the SQLite please read http:https://www.sqlite.org/

@BernardXiong
Copy link
Member

Thank for your contributions.
Some issues:

  1. where is the SConscript file?
  2. Please use rtthread/RTTHREAD instead of rtt/RTT.

@geniusgogo
Copy link
Contributor Author

SConscript在sqlite目录下面
所有函数和变量都要从rtt变成rtthread吗?还是指注释里面?
在 2013-11-24 上午9:18,"Bernard Xiong" [email protected]写道:

Thank for your contributions.
Some issues:

  1. where is the SConscript file?
  2. Please use rtthread/RTTHREAD instead of rtt/RTT.


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29146329
.

@BernardXiong
Copy link
Member

SConscript文件我怎么没找到,能给我个链接吗?

函数和变量都改成rtthread吧,使用rtthread是一种比较正规的方式,虽然有的时候口头可以简称RTT。

@geniusgogo
Copy link
Contributor Author

https://github.com/geniusgogo/rt-thread/tree/sqlite_on_rtthread/components/external/sqlite
主要我传了两份,一份是分散的文件,用来生成独立的sqlite3.c/.h/config.h文件的。这个目录是没有SConscript文件的。
还有一份是使用sqlite3.c/.h/config.h的,这个里面就有SConscript

在 2013年11月24日上午9:35,Bernard Xiong [email protected]写道:

SConscript文件我怎么没找到,能给我个链接吗?

函数和变量都改成rtthread吧,使用rtthread是一种比较正规的方式,虽然有的时候口头可以简称RTT。


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29146564
.

@BernardXiong
Copy link
Member

是否分散的更好?RT-Thread有scons,所以只要SConscript写好,编译不会成为问题的

@geniusgogo
Copy link
Contributor Author

嗯,分散的文件好跟踪,我还没完全看懂他的Makefile和tcl工具在编译时的依赖关系,所以得看看需要哪些文件,稍后我看看……
在 2013-11-24 上午10:07,"Bernard Xiong" [email protected]写道:

是否分散的更好?RT-Thread有scons,所以只要SConscript写好,编译不会成为问题的


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29147050
.

@geniusgogo
Copy link
Contributor Author

用分散的文件,那应用程序不知道要包含哪些头文件,因为此时没有sqlite3.c/.h 之类的文件了。
多数应用程序都是把sqlite3.h当做头文件来引用的。
怎么搞?

在 2013年11月24日上午10:12,geniuscode [email protected]写道:

嗯,分散的文件好跟踪,我还没完全看懂他的Makefile和tcl工具在编译时的依赖关系,所以得看看需要哪些文件,稍后我看看……
在 2013-11-24 上午10:07,"Bernard Xiong" [email protected]写道:

是否分散的更好?RT-Thread有scons,所以只要SConscript写好,编译不会成为问题的


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29147050
.

@grissiom
Copy link
Member

2013/11/24 geniusgogo [email protected]

用分散的文件,那应用程序不知道要包含哪些头文件,因为此时没有sqlite3.c/.h 之类的文件了。
多数应用程序都是把sqlite3.h当做头文件来引用的。
怎么搞?

或许可以自己创建一个 sqlite3.h,在里面把需要的头文件都引用进去。不过这个需要对 sqlite 的代码结构比较熟悉,知道哪些头文件需要被引用~

Cheers,
Grissiom

@bright-pan
Copy link
Contributor

it really too big for rt-thread。。。。。。。。

@geniusgogo
Copy link
Contributor Author

既然我们的目的是为了跟踪上游,那我想不通了,既然上游都没有的东西,我们来造一个,这还叫跟踪吗?
更何况,他还有好几个文件是工具生成出来的。最后合并到一个单文件sqlite3.c里面去了。
我们可以用散列文件跟踪上游,如果有更新,我们则只需要通过工具重新生成一个sqlite3.c出来即可。
官方对外推荐也是这种单文件。
你们怎么看?

在 2013年11月24日下午11:11,Grissiom.GuRui [email protected]写道:

2013/11/24 geniusgogo [email protected]

用分散的文件,那应用程序不知道要包含哪些头文件,因为此时没有sqlite3.c/.h 之类的文件了。
多数应用程序都是把sqlite3.h当做头文件来引用的。
怎么搞?

或许可以自己创建一个 sqlite3.h,在里面把需要的头文件都引用进去。不过这个需要对 sqlite
的代码结构比较熟悉,知道哪些头文件需要被引用~

Cheers,
Grissiom


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29157382
.

@BernardXiong
Copy link
Member

你可以新加入一个sqlite3.h头文件,把一些需要包含的头文件在这个文件中进行include。这样应该是最好的方式。

@geniusgogo
Copy link
Contributor Author

那到没必要加入sqlite3.h这个文件,这个文件是通用的!可以就用现在这个sqlite3.h。
关键是中间生成出来的那几个文件该怎么办!

我再想想,到时候再确认!
这几天身体不舒服,没再跟踪了!

在 2013年11月26日下午3:39,Bernard Xiong [email protected]写道:

你可以新加入一个sqlite3.h头文件,把一些需要包含的头文件在这个文件中进行include。这样应该是最好的方式。


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29272714
.

@BernardXiong
Copy link
Member

类似这样的sqlite3.h:

#ifndef SQLITE3_H
#define SQLITE3_H

#include "sqlite_a.h"
#include "sqlite_b.h"
#include "sqlite_c.h"
...

#endif

@rogerz
Copy link
Member

rogerz commented Nov 26, 2013

没有必要把sqlite已有的构建系统移植为scons吧……只要通过scons去触发sqlite的构建命令生成sqlite3.c/h应该就可以了。

@geniusgogo
Copy link
Contributor Author

这个肯定不行啊,就是单文件太大,再一个,工具不是所有人都有安装……我抽空整……
现在大家的意见是:
1.想把sqlite3.c做成sconscrit脚本来编译散文件的方式
2.中间生成的小c文件如何生成
3.现在大家关注的是sqlite3.h文件怎么实现。
我的意思是,对于第1第2点,只要解决第2点,那么就可以把所有的.c散文件收集齐备了做成sconscrit文件来编译。
对于第3点,可以手动建立sqlite3.h文件包含其它头文件并手动添加没有头文件的api接口。也可以直接用官方的sqlite3.h文件,因为里面已经办好了所有的api接口。
sqlite3.h只是更多的提供给所有其他模块包括应用程序的接口声明,但问题是有的.c里面的api接口根本就没有对应的.h文件,官方是统一生成导出到一个sqlite3.h文件里面,然后给其他模块用的。
在 2013-11-26 下午9:46,"Rogerz Zhang" [email protected]写道:

没有必要把sqlite已有的构建系统移植为scons吧……只要通过scons去触发sqlite的构建命令生成sqlite3.c/h应该就可以了。


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-29292985
.

@rogerz
Copy link
Member

rogerz commented Nov 26, 2013

说句题外话,C的library似乎没有什么好的包管理工具,以致于所有的代码都集中到了rt-thread里面。

@BernardXiong
Copy link
Member

所以目前暂时想到的方式就是在RT-Thread中按照一定类别,放置到一个个目录中。每个目录携带一个SConscript文件,当使用Bridge时,可以自动建立关系然后进行编译。

@geniusgogo geniusgogo closed this Nov 30, 2013
@geniusgogo geniusgogo deleted the sqlite_on_rtthread branch November 30, 2013 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants