Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: Misc/Porting

Issue 15550: Trailing white spaces
Left Patch Set: Created 7 years, 6 months ago
Right Patch Set: Created 7 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Misc/HISTORY ('k') | Misc/python.man » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 Q. I want to port Python to a new platform. How do I begin? 1 Q. I want to port Python to a new platform. How do I begin?
2 2
3 A. I guess the two things to start with is to familiarize yourself 3 A. I guess the two things to start with is to familiarize yourself
4 with are the development system for your target platform and the 4 with are the development system for your target platform and the
5 generic build process for Python. Make sure you can compile and run a 5 generic build process for Python. Make sure you can compile and run a
6 simple hello-world program on your target platform. Make sure you can 6 simple hello-world program on your target platform. Make sure you can
7 compile and run the Python interpreter on a platform to which it has 7 compile and run the Python interpreter on a platform to which it has
8 already been ported (preferably Unix, but Mac or Windows will do, 8 already been ported (preferably Unix, but Mac or Windows will do,
9 too). 9 too).
10 10
11 I also would never start something like this without at least 11 I also would never start something like this without at least
12 medium-level understanding of your target platform (i.e. how it is 12 medium-level understanding of your target platform (i.e. how it is
13 generally used, how to write platform specific apps etc.) and Python 13 generally used, how to write platform specific apps etc.) and Python
14 (or else you'll never know how to test the results). 14 (or else you'll never know how to test the results).
15 15
16 The build process for Python, in particular the Makefiles in the 16 The build process for Python, in particular the Makefiles in the
17 source distribution, will give you a hint on which files to compile 17 source distribution, will give you a hint on which files to compile
18 for Python. Not all source files are relevant -- some are platform 18 for Python. Not all source files are relevant -- some are platform
19 specific, others are only used in emergencies (e.g. getopt.c). The 19 specific, others are only used in emergencies (e.g. getopt.c). The
20 Makefiles tell the story. 20 Makefiles tell the story.
21 21
22 You'll also need a pyconfig.h file tailored for your platform. You can 22 You'll also need a pyconfig.h file tailored for your platform. You can
23 start with pyconfig.h.in, read the comments and turn on definitions that 23 start with pyconfig.h.in, read the comments and turn on definitions that
24 apply to your platform. 24 apply to your platform.
25 25
26 And you'll need a config.c file, which lists the built-in modules you 26 And you'll need a config.c file, which lists the built-in modules you
27 support. Start with Modules/config.c.in. 27 support. Start with Modules/config.c.in.
28 28
29 Finally, you'll run into some things that aren't supported on your 29 Finally, you'll run into some things that aren't supported on your
30 target platform. Forget about the posix module for now -- simply take 30 target platform. Forget about the posix module for now -- simply take
31 it out of the config.c file. 31 it out of the config.c file.
32 32
33 Bang on it until you get a >>> prompt. (You may have to disable the 33 Bang on it until you get a >>> prompt. (You may have to disable the
34 importing of "site.py" by passing the -S option.) 34 importing of "site.py" by passing the -S option.)
35 35
36 Then bang on it until it executes very simple Python statements. 36 Then bang on it until it executes very simple Python statements.
37 37
38 Now bang on it some more. At some point you'll want to use the os 38 Now bang on it some more. At some point you'll want to use the os
39 module; this is the time to start thinking about what to do with the 39 module; this is the time to start thinking about what to do with the
40 posix module. It's okay to simply #ifdef out those functions that 40 posix module. It's okay to simply #ifdef out those functions that
41 cause problems; the remaining ones will be quite useful. 41 cause problems; the remaining ones will be quite useful.
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+