Building and amalgamating libraries on win32 is challenging :)
My assumptions:
- python27 (I have ActiveState python but python.org should be ok) in c:\python27
- visual studio 2010 professional (I think express should work too)
Download bdb and pysqlite (this time I've got 2.6.3) and place it in c:\bdb
,
unpack bdb so you'll have
C:\bdb\db-5.2.36
go in C:\bdb\db-5.2.36\build_windows
pick Berkeley_DB_vs2010.sln
,
select Static Release
as configuration and build
you need to have libdb52s.lib
and libdb_sql52s.lib
in
C:\bdb\db-5.2.36\build_windows\Win32\Static Release
now unpack pysqlite in c:\bdb
, go in C:\bdb\pysqlite-2.6.3
and
edit setup.cfg
as follow:
[build_ext]
include_dirs=C:\bdb\db-5.2.36\lang\sql\generated
library_dirs=C:\bdb\db-5.2.36\build_windows\Win32\Static Release
define=SQLITE_OMIT_LOAD_EXTENSION
be sure to remove libraries= I had to add them to setup.py,
because of static link we need to specify more than one library,
if someone knows a way to specify a list in setup.cfg, please tell me :)
now open setup.py
go at line 191 and replace:
libraries=libraries
with:
libraries=['libdb_sql52s', 'libdb52s', 'ws2_32', 'advapi32'],
open vs2010 command prompt (in visual studio tools menu)
go in c:\bdb\pysqlite
set DISTUTILS_USE_SDK=1
set MSSdk=1
python setup.py build
# ignore errors about manifests, just make sure _sqlite.pyd is built
# make same tests of the linux instructions
python setup.py bdist_wininst
will make the .exe installer in dist subdir