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

Side by Side Diff: PC/example_nt/readme.txt

Issue 15550: Trailing white spaces
Patch Set: Created 7 years, 7 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:
View unified diff | Download patch
« no previous file with comments | « PCbuild/readme.txt ('k') | PC/os2emx/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Example Python extension for Windows NT 1 Example Python extension for Windows NT
2 ======================================= 2 =======================================
3 3
4 This directory contains everything needed (except for the Python 4 This directory contains everything needed (except for the Python
5 distribution!) to build a Python extension module using Microsoft VC++. 5 distribution!) to build a Python extension module using Microsoft VC++.
6 Notice that you need to use the same compiler version that was used to build 6 Notice that you need to use the same compiler version that was used to build
7 Python itself. 7 Python itself.
8 8
9 The simplest way to build this example is to use the distutils script 9 The simplest way to build this example is to use the distutils script
10 'setup.py'. To do this, simply execute: 10 'setup.py'. To do this, simply execute:
11 11
12 % python setup.py install 12 % python setup.py install
13 13
14 after everything builds and installs, you can test it: 14 after everything builds and installs, you can test it:
15 15
16 % python -c "import example; example.foo()" 16 % python -c "import example; example.foo()"
17 Hello, world 17 Hello, world
18 18
19 See setup.py for more details. alternatively, see below for instructions on 19 See setup.py for more details. alternatively, see below for instructions on
20 how to build inside the Visual Studio environment. 20 how to build inside the Visual Studio environment.
21 21
22 Visual Studio Build Instructions 22 Visual Studio Build Instructions
23 ================================ 23 ================================
24 24
25 These are instructions how to build an extension using Visual C++. The 25 These are instructions how to build an extension using Visual C++. The
26 instructions and project files have not been updated to the latest VC 26 instructions and project files have not been updated to the latest VC
27 version. In general, it is recommended you use the 'setup.py' instructions 27 version. In general, it is recommended you use the 'setup.py' instructions
28 above. 28 above.
29 29
30 It has been tested with VC++ 7.1 on Python 2.4. You can also use earlier 30 It has been tested with VC++ 7.1 on Python 2.4. You can also use earlier
31 versions of VC to build Python extensions, but the sample VC project file 31 versions of VC to build Python extensions, but the sample VC project file
32 (example.dsw in this directory) is in VC 7.1 format. 32 (example.dsw in this directory) is in VC 7.1 format.
33 33
34 COPY THIS DIRECTORY! 34 COPY THIS DIRECTORY!
35 -------------------- 35 --------------------
36 This "example_nt" directory is a subdirectory of the PC directory, in order 36 This "example_nt" directory is a subdirectory of the PC directory, in order
37 to keep all the PC-specific files under the same directory. However, the 37 to keep all the PC-specific files under the same directory. However, the
38 example_nt directory can't actually be used from this location. You first 38 example_nt directory can't actually be used from this location. You first
39 need to copy or move it up one level, so that example_nt is a direct 39 need to copy or move it up one level, so that example_nt is a direct
40 sibling of the PC\ and Include\ directories. Do all your work from within 40 sibling of the PC\ and Include\ directories. Do all your work from within
41 this new location -- sorry, but you'll be sorry if you don't. 41 this new location -- sorry, but you'll be sorry if you don't.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 or 122 or
123 123
124 2) Create a brand new project; instructions are below. 124 2) Create a brand new project; instructions are below.
125 125
126 In either case, copy example_nt\example.def to spam\spam.def, and edit the 126 In either case, copy example_nt\example.def to spam\spam.def, and edit the
127 new spam.def so its second line contains the string "initspam". If you 127 new spam.def so its second line contains the string "initspam". If you
128 created a new project yourself, add the file spam.def to the project now. 128 created a new project yourself, add the file spam.def to the project now.
129 (This is an annoying little file with only two lines. An alternative 129 (This is an annoying little file with only two lines. An alternative
130 approach is to forget about the .def file, and add the option 130 approach is to forget about the .def file, and add the option
131 "/export:initspam" somewhere to the Link settings, by manually editing the 131 "/export:initspam" somewhere to the Link settings, by manually editing the
132 "Project -> Properties -> Linker -> Command Line -> Additional Options" 132 "Project -> Properties -> Linker -> Command Line -> Additional Options"
133 box). 133 box).
134 134
135 You are now all set to build your extension, unless it requires other 135 You are now all set to build your extension, unless it requires other
136 external libraries, include files, etc. See Python's Extending and 136 external libraries, include files, etc. See Python's Extending and
137 Embedding manual for instructions on how to write an extension. 137 Embedding manual for instructions on how to write an extension.
138 138
139 139
140 CREATING A BRAND NEW PROJECT 140 CREATING A BRAND NEW PROJECT
141 ---------------------------- 141 ----------------------------
142 Use the 142 Use the
143 File -> New -> Project... 143 File -> New -> Project...
144 dialog to create a new Project Workspace. Select "Visual C++ Projects/Win32/ 144 dialog to create a new Project Workspace. Select "Visual C++ Projects/Win32/
145 Win32 Project", enter the name ("spam"), and make sure the "Location" is 145 Win32 Project", enter the name ("spam"), and make sure the "Location" is
146 set to parent of the spam directory you have created (which should be a direct 146 set to parent of the spam directory you have created (which should be a direct
147 subdirectory of the Python build tree, a sibling of Include and PC). 147 subdirectory of the Python build tree, a sibling of Include and PC).
148 In "Application Settings", select "DLL", and "Empty Project". Click OK. 148 In "Application Settings", select "DLL", and "Empty Project". Click OK.
149 149
150 You should now create the file spam.def as instructed in the previous 150 You should now create the file spam.def as instructed in the previous
151 section. Add the source files (including the .def file) to the project, 151 section. Add the source files (including the .def file) to the project,
152 using "Project", "Add Existing Item". 152 using "Project", "Add Existing Item".
153 153
154 Now open the 154 Now open the
155 Project -> spam properties... 155 Project -> spam properties...
156 dialog. (Impressive, isn't it? :-) You only need to change a few 156 dialog. (Impressive, isn't it? :-) You only need to change a few
157 settings. Make sure "All Configurations" is selected from the "Settings 157 settings. Make sure "All Configurations" is selected from the "Settings
158 for:" dropdown list. Select the "C/C++" tab. Choose the "General" 158 for:" dropdown list. Select the "C/C++" tab. Choose the "General"
159 category in the popup menu at the top. Type the following text in the 159 category in the popup menu at the top. Type the following text in the
160 entry box labeled "Addditional Include Directories:" 160 entry box labeled "Addditional Include Directories:"
161 161
162 ..\Include,..\PC 162 ..\Include,..\PC
163 163
164 Then, choose the "General" category in the "Linker" tab, and enter 164 Then, choose the "General" category in the "Linker" tab, and enter
165 ..\PCbuild 165 ..\PCbuild
166 in the "Additional library Directories" box. 166 in the "Additional library Directories" box.
167 167
168 Now you need to add some mode-specific settings (select "Accept" 168 Now you need to add some mode-specific settings (select "Accept"
169 when asked to confirm your changes): 169 when asked to confirm your changes):
170 170
171 Select "Release" in the "Configuration" dropdown list. Click the 171 Select "Release" in the "Configuration" dropdown list. Click the
172 "Link" tab, choose the "Input" Category, and append "python24.lib" to the 172 "Link" tab, choose the "Input" Category, and append "python24.lib" to the
173 list in the "Additional Dependencies" box. 173 list in the "Additional Dependencies" box.
174 174
175 Select "Debug" in the "Settings for:" dropdown list, and append 175 Select "Debug" in the "Settings for:" dropdown list, and append
176 "python24_d.lib" to the list in the Additional Dependencies" box. Then 176 "python24_d.lib" to the list in the Additional Dependencies" box. Then
177 click on the C/C++ tab, select "Code Generation", and select 177 click on the C/C++ tab, select "Code Generation", and select
178 "Multi-threaded Debug DLL" from the "Runtime library" dropdown list. 178 "Multi-threaded Debug DLL" from the "Runtime library" dropdown list.
179 179
180 Select "Release" again from the "Settings for:" dropdown list. 180 Select "Release" again from the "Settings for:" dropdown list.
181 Select "Multi-threaded DLL" from the "Use run-time library:" dropdown list. 181 Select "Multi-threaded DLL" from the "Use run-time library:" dropdown list.
182 182
183 That's all <wink>. 183 That's all <wink>.
OLDNEW
« no previous file with comments | « PCbuild/readme.txt ('k') | PC/os2emx/Makefile » ('j') | no next file with comments »

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