代码在:http://code.google.com/p/sqlite-autobuild-win/
原理比较简单:
提供一下版本号,执行脚本sqlite_build.bat 时,会自动从sqlite官网上下载相关源码,最终为你编译生成你要的sqlite3.dll以及独立的sqlite3.exe。
同时你也拥有完整的源代码,非常方便。
目前支持如下版本号:
3_6_16
3_6_22
3_6_3
3_7_3
3070400
3071400
3080000
3080100
3080200
支持的编译器从VC6开始,VS2003, VS2005, VS2008等。
在进入命令行之前,先要初始化VC编译器环境,找到VCVARS32.bat,执行一下,或者VSTools->Visual Studio Command Prompt. 这样,cl, link等命令就都在PATH里头,可以用于编译了。
下边是执行3080200这个版本的完整输出信息:
点击(此处)折叠或打开
- D:\Projects\springtech\trunk\sqlite>sqlite_build.bat 3080200
- fetching sqlite-amalgamation-3080200.zip ...
- --2013-12-28 06:23:35-- http://www.sqlite.org/sqlite-amalgamation-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 404 Not Found
- 2013-12-28 06:23:36 ERROR 404: Not Found.
- --2013-12-28 06:23:36-- http://www.sqlite.org/2013/sqlite-amalgamation-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 1473300 (1.4M) [application/zip]
- Saving to: `sqlite-amalgamation-3080200.zip'
- 100%[==========================================================>] 1,473,300 295K/s in 6.0s
- 2013-12-28 06:23:42 (242 KB/s) - `sqlite-amalgamation-3080200.zip' saved [1473300/1473300]
- 7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
- Processing archive: sqlite-amalgamation-3080200.zip
- Extracting sqlite-amalgamation-3080200
- Extracting sqlite-amalgamation-3080200\shell.c
- Extracting sqlite-amalgamation-3080200\sqlite3.c
- Extracting sqlite-amalgamation-3080200\sqlite3ext.h
- Extracting sqlite-amalgamation-3080200\sqlite3.h
- Everything is Ok
- Folders: 1
- Files: 4
- Size: 5634577
- Compressed: 1473300
- D:\Projects\springtech\trunk\sqlite\sqlite-amalgamation-3080200\sqlite-amalgamation-3080200\shell.c
- D:\Projects\springtech\trunk\sqlite\sqlite-amalgamation-3080200\sqlite-amalgamation-3080200\sqlite3.c
- D:\Projects\springtech\trunk\sqlite\sqlite-amalgamation-3080200\sqlite-amalgamation-3080200\sqlite3.h
- D:\Projects\springtech\trunk\sqlite\sqlite-amalgamation-3080200\sqlite-amalgamation-3080200\sqlite3ext.h
- 移动了 4 个文件。
- fetching sqlitedll-3080200.zip ...
- --2013-12-28 06:23:43-- http://www.sqlite.org/sqlitedll-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 404 Not Found
- 2013-12-28 06:23:43 ERROR 404: Not Found.
- --2013-12-28 06:23:44-- http://www.sqlite.org/2013/sqlitedll-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 404 Not Found
- 2013-12-28 06:23:44 ERROR 404: Not Found.
- 7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
- Error:
- cannot find archive
- 系统找不到指定的路径。
- 系统找不到指定的文件。
- fetching sqlite-dll-win32-x86-3080200.zip ...
- --2013-12-28 06:23:45-- http://www.sqlite.org/sqlite-dll-win32-x86-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 404 Not Found
- 2013-12-28 06:23:45 ERROR 404: Not Found.
- --2013-12-28 06:23:45-- http://www.sqlite.org/2013/sqlite-dll-win32-x86-3080200.zip
- Resolving www.sqlite.org... 67.18.92.124
- Connecting to www.sqlite.org|67.18.92.124|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 327949 (320K) [application/zip]
- Saving to: `sqlite-dll-win32-x86-3080200.zip'
- 100%[==========================================================>] 327,949 147K/s in 2.2s
- 2013-12-28 06:23:48 (147 KB/s) - `sqlite-dll-win32-x86-3080200.zip' saved [327949/327949]
- 7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
- Processing archive: sqlite-dll-win32-x86-3080200.zip
- Extracting sqlite3.def
- Extracting sqlite3.dll
- Everything is Ok
- Files: 2
- Size: 646431
- Compressed: 327949
- 已复制 1 个文件。
- begin building sqlite-amalgamation-3080200
- cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
- cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
- cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
- shell.c
- sqlite3.c
- Generating Code...
- sqlite3.exe build finished ......
- cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
- cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
- cl : Command line warning D9035 : option 'GZ' has been deprecated and will be removed in a future release
- cl : Command line warning D9036 : use 'RTC1' instead of 'GZ'
- cl : Command line warning D9002 : ignoring unknown option '/MLd'
- cl : Command line warning D9002 : ignoring unknown option '/YX'
- cl : Command line warning D9002 : ignoring unknown option '/debug'
- sqlite3.c
- LINK : warning LNK4044: unrecognized option '/pdbtype:sept'; ignored
- LINK : sqlite3.dll not found or not built by the last incremental link; performing full link
- Creating library sqlite3.lib and object sqlite3.exp
- sqlite3.dll build finished ......
- end building sqlite-amalgamation-3080200
- -----------------------------------------------
在google code上也有完整的readme.
下载方法:
用tortoise svn client, 就可以直接下载:
svn checkout http://sqlite-autobuild-win.googlecode.com/svn/trunk/ sqlite-autobuild-win-read-only
如果你有兴趣,也可以加入此开源项目,共同维护以后各个branch的自动下载和编译。