diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2008-04-07 01:53:39 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2008-04-07 01:53:39 (GMT) |
commit | 495cf99aaf40fb1c0859e528d5b2c52018fba09f (patch) | |
tree | 7eccc4215be221e4f5aae27a487e69d8057c2465 /PC | |
parent | aa63d0d4af3db832b390ac74517af5eb799540e5 (diff) | |
download | cpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.zip cpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.tar.gz cpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.tar.bz2 |
Issue #2513: enable 64bit cross compilation on windows.
Diffstat (limited to 'PC')
-rw-r--r-- | PC/example_nt/readme.txt | 34 | ||||
-rw-r--r-- | PC/example_nt/setup.py | 22 |
2 files changed, 50 insertions, 6 deletions
diff --git a/PC/example_nt/readme.txt b/PC/example_nt/readme.txt index 37a9c29..b83888c 100644 --- a/PC/example_nt/readme.txt +++ b/PC/example_nt/readme.txt @@ -2,12 +2,34 @@ Example Python extension for Windows NT ======================================= This directory contains everything needed (except for the Python -distribution!) to build a Python extension module using Microsoft VC++ -("Developer Studio") version 7.1. It has been tested with VC++ 7.1 on -Python 2.4. You can also use earlier versions of VC to build Python -extensions, but the sample VC project file (example.dsw in this directory) -is in VC 7.1 format. Notice that you need to use the same compiler version -that was used to build Python itself. +distribution!) to build a Python extension module using Microsoft VC++. +Notice that you need to use the same compiler version that was used to build +Python itself. + +The simplest way to build this example is to use the distutils script +'setup.py'. To do this, simply execute: + + % python setup.py install + +after everything builds and installs, you can test it: + + % python -c "import example; example.foo()" + Hello, world + +See setup.py for more details. alternatively, see below for instructions on +how to build inside the Visual Studio environment. + +Visual Studio Build Instructions +================================ + +These are instructions how to build an extension using Visual C++. The +instructions and project files have not been updated to the latest VC +version. In general, it is recommended you use the 'setup.py' instructions +above. + +It has been tested with VC++ 7.1 on Python 2.4. You can also use earlier +versions of VC to build Python extensions, but the sample VC project file +(example.dsw in this directory) is in VC 7.1 format. COPY THIS DIRECTORY! -------------------- diff --git a/PC/example_nt/setup.py b/PC/example_nt/setup.py new file mode 100644 index 0000000..0443bc7 --- /dev/null +++ b/PC/example_nt/setup.py @@ -0,0 +1,22 @@ +# This is an example of a distutils 'setup' script for the example_nt +# sample. This provides a simpler way of building your extension +# and means you can avoid keeping MSVC solution files etc in source-control. +# It also means it should magically build with all compilers supported by +# python. + +# USAGE: you probably want 'setup.py install' - but execute 'setup.py --help' +# for all the details. + +# NOTE: This is *not* a sample for distutils - it is just the smallest +# script that can build this. See distutils docs for more info. + +from distutils.core import setup, Extension + +example_mod = Extension('example', sources = ['example.c']) + + +setup(name = "example", + version = "1.0", + description = "A sample extension module", + ext_modules = [example_mod], +) |