首页 > 数据库 >Compile Sqlite3 Executable, Static Library, and Shared Library on Linux

Compile Sqlite3 Executable, Static Library, and Shared Library on Linux

时间:2023-01-26 10:33:07浏览次数:51  
标签:Executable ENABLE EXPLAIN Library Compile DHAVE DSQLITE

Download Sqlite3 source code, and decompress it to somewhere.

Enter the decompressed folder, type the following command to generate different targets with all features.

Executable

gcc -fPIC -Os -I. -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_FTS4    -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS    -DHAVE_USLEEP -DHAVE_READLINE shell.c sqlite3.c -ldl -lm -lreadline -lncurses -lpthread -o sqlite34

Static Library

gcc -Os -I. -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_FTS4    -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1    -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS    -DHAVE_USLEEP -DHAVE_READLINE sqlite3.c -fPIC -c -o sqlite34.o

ar rcs libsqlite34.a sqlite34.o

Shared Library

gcc -Os -I. -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_FTS4    -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1    -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS    -DHAVE_USLEEP -DHAVE_READLINE sqlite3.c -ldl -lm -lreadline -lncurses -fPIC -lpthread -shared -o libsqlite34.so

标签:Executable,ENABLE,EXPLAIN,Library,Compile,DHAVE,DSQLITE
From: https://www.cnblogs.com/Jedimaster/p/17067605.html

相关文章