[python-win32] Some compile hints for Win32
-=
-=
Sat Aug 28 15:55:11 CEST 2004
Hello!
I'm newbie in Python, but i've already understood it's power!
I prefer to use own built Python (I use MSVC 6 on Win98)
& want to share some win32's compile hints with Python community.
Tips:
-----
1. Use /FILEALIGN:0x200 linker option on every .pyd, .exe, .dll file
to remove empty space between PE sections (Is it MS linker bug on Win98?).
--------------------------------------------------------------------------
2. To build _bsddb.pyd you just need to build a "db_static" project
in Berkeley_DB Workspace and not WHOLE "build_all". Change properties of
"db_static" to "Multithreaded DLL" (/MD option of compiler) and you will NOT
get this message:
"
LINK : warning LNK4049: locally defined symbol "_malloc" imported
LINK : warning LNK4049: locally defined symbol "_free" imported
LINK : warning LNK4049: locally defined symbol "_fclose" imported
LINK : warning LNK4049: locally defined symbol "_fopen" imported
"
Of course, your Python's _bsddb.pyd must have the same /MD option and NOT
"ignore msvcrt lib"
-------------------
3. I prefer to build _ssl module manually with this steps:
in OPENSSL dir:
a) perl configure VC-WIN32
b) ms\do_nasm.bat
i use nasm to compile asm modules. just place nasmw.exe in somewhere in
"PATH" dir before compile.
c) nmake -f ms\nt.mak
after OPENSSL've finished change current dir to Python's build dir
and find "_ssl.mak"
d) SET SSL_DIR=your OPENSSL dir
e) nmake -f _ssl.mak (you may add /FILEALIGN:0x200 option in .mak file
as mentioned above)
-------------------
4. You can use UPX with "--best" option to pack all .exe,.pyd,.dll files
into small ones. For very greedy persons: you can use realign tools like
PEditor, LordPE to rebuild and realign files after UPX compression
(saves 100-700 bytes ;) )
-------------------------
5. You can build Tcl+Tk with "threads" option, just do not forget to change
"tcl84.lib" and "tk84.lib" in "_tkinter" project to "tcl84t.lib" and
"tk84t.lib" respectively.
-------------------------
6. Of course, you can use newer versions of Berkeley DB, Tcl+Tk, Zlib in
your Python's modules - just do not forget to change path and name of
import libs.
------------
7. That's all for now! Sorry for my bad English :(
Good luck to all Python's community!!!
More information about the Python-win32
mailing list