I am following this tutorial for compiling SQLite with SQLCipher on Windows. I am confused about pre-requisites for compilation. I found that I need to install following to compile it:
- OpenSSL
- MinGW
- ActiveState Perl
- TclTk / tclsh
- MSYS
- Visual Studio 开发者_高级运维
- Cygwin
Among all above, I just have Visual Studio 2008 installed. I am working on Windows 7.
What are exact pre-requisites for compiling SQLite with SQLCipher on Windows?
It seems that SQLCipher is distributed as a checkout of SQLite sources + modifications, judging by a quick look - and that being the multi-file version rather than the "amalgation". Thus, you need an environment capable of building SQLite sources, which means a bunch of unixy apps.
Personally, I'd do a diff between the SQLCipher source archives and the SQLite version it includes (which seems to be SQLite 3.7.2 for SQLCipher 1.8.2, judging by the VERSION file) - this should give an idea which modifications, if any, are done to the source SQLite files, as well as list files particular to SQLCipher.
To avoid hassles with building OpenSSL manually, you can grab prebuilt versions, which rids you of the Perl dependencies (iirc OpenSSL builds fine with Visual C++, so MingW shouldn't be a dependency).
If the SQLCipher author hasn't purposefully made the job of separating his specific code parts from SQLite tricky (which he might have, to cash in some money from selling win32 binaries), you'd be able to take his changes and combine with a SQLite amalgation version and prebuilt OpenSSL binaries, which should make for a really easy drop-in in a Visual Studio solution.
Of course it means you'll have to go through the extraction step if you want to upgrade to a newer version of SQLCipher, but it'd probably be worth it, unless you really want to install a cygwin development environment just to be able to build this single library.
Alternatively, you might be able to do the configure step of SQLCipher on a *u*x box (whether that being linux, *BSD or a Mac OS X shell), since the compile step shouldn't require all the funky tools.
UPDATE:
I checked out (version 3.7.2)[http://www.sqlite.org/src/info/42537b6056] of SQLite and ran a diff against the SQLCipher 1.1.8 distribution, and it seems like a pretty reasonable task to extract the modified portions:
Makefile.in - references added for the new crypto files. tool/mksqlite3c.tcl: references added for the new crypto files. src/pragma.c - one added block, marked /** BEGIN_CRYPTO **/ src/pager.c - one added block, marked /** BEGIN_CRYPTO **/ src/crypto.h - new file. src/crypto.c - new file.
Also, it seems pretty overkill to take a dependency on OpenSSL just to get AES crypto support - building something new based on SQLCipher to use a dedicated (and much smaller) AES package would be nicer.
The minimal setup you need to compile SQLCipher on windows is:
- OpenSSL, either in source or binary
- forms Perl - Optional, only required if you build OpenSSL
- MinGW / MSYS - required to configure SQLCipher
- Tcl - required by the SQLite build system to build the amalgamation code
- Visual Studio - to build your project
Using the steps in the thread, you can create the DLLs directly or generate an amalgamation to include in your project.
If you want to save all those steps and time, for a small charge you can also get precompiled SQLCipher windows binaries from the website at http://sqlcipher.net/downloads. These binary sales are mutually beneficial since they can help you get working more quickly, and they help support the project.
精彩评论