Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
14e5ee9c
Commit
14e5ee9c
authored
Aug 10, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mini-faq on porting python
parent
8f13ac40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
Misc/NEWS
Misc/NEWS
+2
-2
Misc/Porting
Misc/Porting
+42
-0
No files found.
Misc/NEWS
View file @
14e5ee9c
...
...
@@ -167,8 +167,8 @@ can now use it to run arbitrary Python scripts in restricted mode).
long ago.
- Major upgrade to ConfigParser.py; converted to using 're', added new
exceptions, support underscore in section header and option name
, n
o
longer add 'name' option to every section.
exceptions, support underscore in section header and option name
. N
o
longer add 'name' option to every section
; instead, add '__name__'
.
- The ihooks.py module now understands package imports.
...
...
Misc/Porting
0 → 100644
View file @
14e5ee9c
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.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment