summaryrefslogtreecommitdiffstats
path: root/Misc/Porting
blob: 570eaff184563a150ed4ac6d62d63efcd6069d51 (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
Q. I want to port Python to a new platform.  How do I begin?

A. I guess the two things to start with is to familiarize yourself
with are the development system for your target platform and the
generic build process for Python.  Make sure you can compile and run a
simple hello-world program on your target platform.  Make sure you can
compile and run the Python interpreter on a platform to which it has
already been ported (preferably Unix, but Mac or Windows will do,
too).

I also would never start something like this without at least
medium-level understanding of your target platform (i.e. how it is
generally used, how to write platform specific apps etc.) and Python
(or else you'll never know how to test the results).

The build process for Python, in particular the Makefiles in the
source distribution, will give you a hint on which files to compile
for Python.  Not all source files are relevant -- some are platform
specific, others are only used in emergencies (e.g. getopt.c).  The
Makefiles tell the story.

You'll also need a config.h file tailored for your platform.  You can
start with config.h.in, read the comments and turn on definitions that
apply to your platform.

And you'll need a config.c file, which lists the built-in modules you
support.  Start with Modules/config.c.in.

Finally, you'll run into some things that aren't supported on your
target platform.  Forget about the posix module for now -- simply take 
it out of the config.c file.

Bang on it until you get a >>> prompt.  (You may have to disable the
importing of "site.py" and "exceptions.py" by passing -X and -S
options.

Then bang on it until it executes very simple Python statements.

Now bang on it some more.  At some point you'll want to use the os
module; this is the time to start thinking about what to to with the
posix module.  It's okay to simply #ifdef out those functions that
cause problems; the remaining ones will be quite useful.
.3&id=b0eeea8a2ff13e1449dd98ef5c43c1c89e2e357b'>Add a test case for commit 76d767080a6be7b025f36d6778dfaedbd31a9f07Tasuku Suzuki2010-03-181-0/+52 | * Add Japanese/Korean keyboard specific keys to QKeySequenceTasuku Suzuki2010-03-181-0/+35 | * Fixed qmdiarea autotest regression on CocoaDenis Dzyubenko2010-03-181-1/+2 | * Fix JSC export macrosKent Hansen2010-03-182-2/+2 | * Minor update for f3f979cbd37f47892cd0c0a9fc23b802ed6f7890Prasanth Ullattil2010-03-181-0/+2 | * Incorrect translation for Application menu items in Mac.Prasanth Ullattil2010-03-1814-18/+179 | * doc: Fixed use of Qt 3 support function in QIcon doc snippetThorbjørn Lindeijer2010-03-181-2/+2 | * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integ...Qt Continuous Integration System2010-03-1889-548/+2472 | |\ | | * Build and run QElapsedTimer test.Aaron McCarthy2010-03-181-0/+1 | | * Fix license headers.Aaron McCarthy2010-03-184-0/+164 | | * Add flag to indicate that network sessions are expected on a platform.Aaron McCarthy2010-03-188-20/+15 | | * Don't fail unit test when there is no default network configuration.Aaron McCarthy2010-03-181-5/+3 | | * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integ...Qt Continuous Integration System2010-03-1880-523/+2289 | | |\ | | | * Make destructor virtual.Aaron McCarthy2010-03-181-1/+1 | | | * Optimized QLocale to access system locale on demand.Denis Dzyubenko2010-03-174-54/+185 | | | * Remove unwanted code in f8d5f2594a9b268b9eeecf95b24b23fc940c71cePrasanth Ullattil2010-03-17