Staging
v0.5.1
https://github.com/python/cpython
Revision 9d2fde7235f54d0feed91c451dadef118c982eff authored by Georg Brandl on 07 February 2010, 11:59:25 UTC, committed by Georg Brandl on 07 February 2010, 11:59:25 UTC
........
  r78018 | georg.brandl | 2010-02-06 11:08:21 +0100 (Sa, 06 Feb 2010) | 1 line

  #7864: make deprecation notices a bit clearer.
........
  r78019 | georg.brandl | 2010-02-06 11:23:16 +0100 (Sa, 06 Feb 2010) | 1 line

  Review sysconfig docs.
........
  r78032 | georg.brandl | 2010-02-06 22:54:40 +0100 (Sa, 06 Feb 2010) | 1 line

  Remove unused imports from test_logging.
........
  r78036 | georg.brandl | 2010-02-06 23:49:47 +0100 (Sa, 06 Feb 2010) | 1 line

  Remove unused import.
........
  r78037 | georg.brandl | 2010-02-06 23:59:15 +0100 (Sa, 06 Feb 2010) | 1 line

  No need to assign the results of expressions used only for side effects.
........
  r78038 | georg.brandl | 2010-02-07 00:02:29 +0100 (So, 07 Feb 2010) | 1 line

  Add a missing import.
........
  r78039 | georg.brandl | 2010-02-07 00:06:24 +0100 (So, 07 Feb 2010) | 1 line

  Add missing imports.
........
  r78042 | georg.brandl | 2010-02-07 00:12:12 +0100 (So, 07 Feb 2010) | 1 line

  Add missing import.
........
  r78046 | georg.brandl | 2010-02-07 00:18:00 +0100 (So, 07 Feb 2010) | 1 line

  Fix various missing import/unbound name errors.
........
  r78048 | georg.brandl | 2010-02-07 00:23:45 +0100 (So, 07 Feb 2010) | 1 line

  We heard you like test failures so we put unbound locals in your test so that you can fail while you fail.
........
  r78051 | georg.brandl | 2010-02-07 00:53:52 +0100 (So, 07 Feb 2010) | 1 line

  Add missing import when running these tests standalone.
........
  r78059 | georg.brandl | 2010-02-07 12:34:15 +0100 (So, 07 Feb 2010) | 1 line

  Use "regexp" consistently.
........
1 parent 9b831f4
Raw File
Tip revision: 9d2fde7235f54d0feed91c451dadef118c982eff authored by Georg Brandl on 07 February 2010, 11:59:25 UTC
Blocked revisions 78018-78019,78032,78036-78039,78042,78046,78048,78051,78059 via svnmerge
Tip revision: 9d2fde7
Porting
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 pyconfig.h file tailored for your platform.  You can
start with pyconfig.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 do with the
posix module.  It's okay to simply #ifdef out those functions that
cause problems; the remaining ones will be quite useful.
back to top