Friday, December 5, 2008

Building PythonCE from source

I have recently had the need to compile PythonCE from source, which turned out to be a quite complex task. Therefore I have decided to write this blog post, so that others may avoid wasting the many hours that I wasted trying to get it to build.

My setup for building PythonCE was this: Windows XP SP2, Microsoft eMbedded Visual C++ 4 with SP4, Pocket PC 2003 SDK, and Python 2.5.

To actually build the thing you need to download the PythonCE source, unzip it, enter the PCBuild/WinCE directory, and typing “scons”. This failed on my machine though, which I later found was due to a missing registry key in my Pocket PC 2003 SDK install (or something of the likes). To get it to compile i edited the file PCbuild/WinCE/msevc.py and made a small correction to the get_msevc_paths function - this is shown below. The addition I made was in the except-clause, where I manually set the exe_path.



def get_msevc_paths(env):
...
try:
value, value_type = SCons.Util.RegQueryValueEx(hkey, 'Path Dirs')
exe_path = str(value.decode('utf_16_le').rstrip(u'\x00'))
except (SCons.Util.RegError, SCons.Errors.InternalError):
exe_path="C:\\Program Files\\Microsoft eMbedded C++ 4.0\\"\
"EVC\\wce420\\bin;C:\\Program Files\\"\
"Microsoft eMbedded C++ 4.0\\Common\\EVC\\Bin"

No comments:

Post a Comment