linux认证:ucLinux下sqlite数据库移植全攻略(3)
) q' \8 F' a& x3 b注:5 S$ }; a) O3 Z- U6 r/ q+ g
1、 在uclinux下的sqlite的Makefile将不去用到TCL相关的库。
. Y+ N8 }" \8 m# r- W+ f7 |( r S2、 在uclinux下的sqlite的Makefile将不去用到readline()。' W( [/ W% B3 C8 m9 G7 C" ]. _
在sqlite/README中有关于Makefile的一段描述:1 M T( F; Z* ^% ~
The configure script uses autoconf 2.50 and libtool. If the configure script does not work out for you, there is a generic makefile named “Makefile.linux-gcc” in the top directory of the source tree that you can copy and edit to suite your needs. Comments on the generic makefile show what changes are needed.
% ^% z6 I7 Z5 G3 r3 ^$ C6 C! T6 q$ U你可以用sqlite/Makefile.linux-gcc作为蓝本来修改适合你自己的Makefile。
' U9 w3 G- u& c* \你如果有兴趣的话,可以把上面的Makefile的内容和sqlite/Makefile.linux-gcc内容diff对比一下,看看uclinux下的sqlite编译有哪些不同的地方。
& {" y- P: u4 H3 V5 h% X三、修改sqlite/src/os.c. H" a. m; {/ N* |3 g" V: Z
如果你的sqlite包中包括os.c文件那么就对其进行修改,没有os.c文件可能是你的sqlite版本比较新,那么无须修改。
9 d; a0 J* _0 @% n) K1 q/ D6 l将所有你找到的:+ F% P, G) s3 f$ v
if( s!=0 )
8 D' `8 I% ^3 j用:
1 o0 I' q0 Q! `1 g7 J. eif( s!=0 && errno != ENOSYS )
" a# p c/ F8 U2 {/ u8 l+ k替换。
# F9 u* y8 ~7 s0 G, |9 n6 G( @% u四、修改sqlite/src/shell.c
, e) ~+ q4 f+ N$ ~$ O$ g1、struct previous_mode_data 结构定义项:
8 [8 q# s0 w8 C* F+ Y5 B将 int colWidth[100];
- A6 c: j/ m- Z+ _9 ^用 int colWidth[20];
2 h* \' y( _1 t2 W替换。
) i5 |) r' ?0 r; @- P+ w2、struct callback_data 结构定义项& \) M: ]% {& }
将:2 x, f. X3 N* d. Z1 g8 E2 I
int colWidth[100];6 D6 A" a4 s% ]6 b$ T' J0 E7 h0 M! S
int actualWidth[100];) ^- A' J+ v5 B# m$ E% x. {/ n+ O9 O
char outfile[FILENAME_MAX];
: ]! e' |. u! f) w3 K" F用:1 l. g$ X4 ]5 w* p0 C2 x* j N
int colWidth[20];
' _# |, o% [. H4 Cint actualWidth[20];
5 |, ~- p, O+ {9 Jchar *outfilep;
J% i, w' V( h. C对应替换。6 h; B$ N9 V+ l$ x x% g7 k; n
再在结构下面增加:
) `9 ?2 U/ i' b4 I( o#ifndef FILENAME_MAX! B. T% q4 N( n
#define FILENAME_MAX 4095" U. J1 Y' ?# U
#endif) u' v8 I% @# d/ v+ w5 Z
char outfilename[FILENAME_MAX]; /* Filename for *out */1 s# e2 |; d" a9 ~8 R6 J
即
' k0 r- ~; ]* u& e& @; [* P8 \struct callback_data
- k# Q- H! v; p5 c1 _! j{
3 U/ Q" N1 w4 k# y. L/ X; i。。.
1 P* s0 r+ ^4 r/ h) J};
; _9 R5 y! g0 O0 c#ifndef FILENAME_MAX
" U; ~0 E& _* z! P ~. z' b* f#define FILENAME_MAX 4095
3 H* h1 Y: S& G2 I/ g' [#endif7 X' Q- y6 G) D
char outfilename[FILENAME_MAX]; /* Filename for *out */ |