[PythonCE] Building under Visual Studio 2005 for Devices
Christopher Fairbairn
christopher at christec.co.nz
Fri Mar 9 04:42:10 CET 2007
Hi,
>If it is possible to modify the PCBuild8 project files so that Python can be
>built for both desktop Windows and Windows CE then yes, this may well be the
>simplest option. However, if Windows CE would require separate project files
>then I think it would be better to adapt the SCons scripts.
I have had a quick play around with getting a build working using the Visual Studio 2005 compilers and have managed
to get a version compiled on my machine via the SCons scripts. It appears to be running fine on my PDA.
A brief summary of what I needed to do.
1) Modified msevc.py to change some of the tool names (cl.exe vs clarm.exe) and command line arguments as required
for the VS2005 compilers. At present I also hardcoded some of the file paths required rather than writing the code to
reliably find them in the registry etc.
2) Tweaked a few conditional compile statements throughout the source code (about two or three from memory) due to
the conditional expressions being incorrect due to the use of the VS2005 compiler during WinCE builds. For instance,
the following condition found within pythonrun.c is now slightly incorrect.
/* Special signal handling for the secure CRT in Visual Studio 2005 */
#if defined(_MSC_VER) && _MSC_VER >= 1400
This condition includes code which is specific to the desktop runtime environment (but now evaluates to true due to
me using the same version of the compiler), so ideally it needs a further condition added to avoid it including the
code when targeting the WinCE platform with this compiler version.
If I took the time to clean up and complete these patches would there be interest in including support for building
PythonCE with Visual Studio 2005?
Thanks,
Christoher Fairbairn
PS: When I ran SCons it built the Python25.dll, Python25.exe and Python25.zip files. However it didn't build the cab
file. I notice there is code within the 'SConstruct' file which appears to be designed to automate the cab building
process (I manually ran cabwiz.exe on the inf file), how do I run this script?
More information about the PythonCE
mailing list