| 87 | ===== Building on Windows |
| 88 | [https://github.com/ghaering/pysqlite/issues/89 pysqlite issue 89] lists the trouble you'd get when trying to build PySqlite on Windows. Either follow the advice found there, or use the somewhat simpler steps described below. |
| 89 | |
| 90 | First you need to obtain the SQLite amalgamation source files. |
| 91 | The simplest way to do this is to use the amalgamation .zip you'll find in http://www.sqlite.org/download.html, but that will only work if you want the latest released version of SQLite, which is the typical use case. |
| 92 | |
| 93 | If you need another version, you can get it from the SQLite source repository: |
| 94 | 1. retrieve the code from [http://www.sqlite.org/getthecode.html the fossil repository] |
| 95 | 2. prepare the amalgamation source, as explained in [http://www.sqlite.org/amalgamation.html#amalgbuild Building The Amalgamation From Canonical Source Code] |
| 96 | |
| 97 | At this point you have the `sqlite3.h` and `sqlite3.c` source files. |
| 98 | |
| 99 | 1. Extract the .tar.gz distribution of PySqlite, or clone the repository, to a `pysqlite` directory |
| 100 | 2. In `pysqlite`, create a subdirectory named "internal" |
| 101 | 3. Copy the amalgamation files `sqlite3.h` and `sqlite3.c` into that directory |
| 102 | 4. Change directory to `pysqlite/internal`, build the amalgamation static library (assuming you have the shell set up correctly to use `cl` and `lib`): |
| 103 | {{{#!shell |
| 104 | cl -c sqlite3.c |
| 105 | lib sqlite3.obj -out:sqlite3.lib |
| 106 | }}} |
| 107 | 5. Now go back to the `pysqlite` directory and build the standard way: `python setup.py install`: due to a bug explained in the issue 89, the "internal" directory is present in both the include path and the library path... Crude but it works ;-) |
| 108 | |
| 109 | |