blob: 01f6e70e8c2efa2ba97a079bccb2a8dd695702bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
===========================
Building PySQLite on Windows
============================
On Windows, Python's distutils defaults to the Visual C++ compiler from
Microsoft. If you want to use other compilers for compiling Python extensions
on Windows, look into chapter 3.1 "Using non-Microsoft compilers on Windows" in
the "Installing Python Modules" of your Python documentation. It's available
online at http://www.python.org/doc/current/inst/non-ms-compilers.html
The following are build instructions for the GNU C compiler, Borland C++ and
for Microsoft's Visual C++ environment.
========================
Using the GNU C compiler
========================
As you have read the Python documentation for non-Microsoft compilers by now,
you have mingw or Cygwin installed and created the required import library for
the Python DLL. Fine, let's continue.
From http://www.hwaci.com/sw/sqlite/download.html get the sqlite_source.zip and
sqlitedll.zip files. Unpack them all in the same directory.
Create an import library for the GNU linker:
$ dlltool --def sqlite.def --dllname sqlite.dll --output-lib libsqlite.a
Unpack the PySQLite sources and open setup.py in your editor. Search for
"win32". Change the include_dirs and library_dirs variable to point the place
where you've unpacked the SQLite files and where you created the import
library.
Build PySQLite:
$ python setup.py build --compiler=mingw32
==========================
Using the Borland compiler
==========================
As you have read the Python documentation for non-Microsoft compilers by now,
you have installed the Borland C++ compiler and created the required import
library for the Python DLL. Fine, let's continue.
From http://www.hwaci.com/sw/sqlite/download.html get the sqlite_source.zip and
sqlitedll.zip files. Unpack them all in the same directory.
Create an import library for the Borland linker:
$ implib -a sqlite.lib sqlite.dll
Unpack the PySQLite sources and open setup.py in your editor. Search for
"win32". Change the include_dirs and library_dirs variable to point the place
where you've unpacked the SQLite files and where you created the import
library.
Build PySQLite:
$ python setup.py build --compiler=bcpp
==========================
Using Microsoft Visual C++
==========================
From http://www.hwaci.com/sw/sqlite/download.html get the sqlite_source.zip and
sqlitedll.zip files. Unpack them all in the same directory.
Create an import library for the Microsoft linker:
$ lib /def:sqlite.def
Unpack the PySQLite sources and open setup.py in your editor. Search for
"win32". Change the include_dirs and library_dirs variable to point the place
where you've unpacked the SQLite files and where you created the import
library.
Build PySQLite:
$ python setup.py build
==================================
What to do after building pySQLite
==================================
- Make sure the sqlite.dll can be found. Either copy it into your system
directory, somewhere else in your PATH or in the same directory as the .pyd
file from pySQLite.
- Run the included test suite with these or similar commands:
$ copy ..\sqlite\sqlite.dll build\lib.win32-2.2
$ copy test\*.py build\lib.win32-2.2
$ cd build\lib.win32-2.2
$ python all_tests.py
All the tests should pass. If something goes wrong, report it to the pySQLite
developers using the Sourceforge bug tracker.
- Install pySQLite:
$ python setup.py install
Again make sure the sqlite.dll can be found
|