Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 1 | Quick Start Guide |
| 2 | ----------------- |
| 3 | |
| 4 | 1. Install Microsoft Visual C++ 2010 SP1, any edition. |
| 5 | 2. Install Subversion, and make sure 'svn.exe' is on your PATH. |
| 6 | 3. Install NASM, and make sure 'nasm.exe' is on your PATH. |
| 7 | 4. Run "build.bat -e" to build Python in 32-bit Release configuration. |
| 8 | 5. (Optional, but recommended) Run the test suite with "rt.bat -q". |
| 9 | |
| 10 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 11 | Building Python using Microsoft Visual C++ |
| 12 | ------------------------------------------ |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 13 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 14 | This directory is used to build CPython for Microsoft Windows NT version |
| 15 | 5.1 or higher (Windows XP, Windows Server 2003, or later) on 32 and 64 |
| 16 | bit platforms. Using this directory requires an installation of |
| 17 | Microsoft Visual C++ 2010 (MSVC 10.0) of any edition. The specific |
| 18 | requirements are as follows: |
Zachary Ware | 5f3e3c3 | 2014-03-19 14:46:25 -0500 | [diff] [blame] | 19 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 20 | Visual C++ 2010 Express Edition |
| 21 | Required for building 32-bit Debug and Release configuration builds. |
Zachary Ware | ef03565 | 2014-07-07 14:33:24 -0500 | [diff] [blame] | 22 | The Python build solution pcbuild.sln makes use of Solution Folders, |
| 23 | which this edition does not support. Any time pcbuild.sln is opened |
| 24 | or reloaded by Visual C++, a warning about Solution Folders will be |
| 25 | displayed which can be safely dismissed with no impact on your |
| 26 | ability to build Python. |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 27 | Visual Studio 2010 Professional Edition |
Zachary Ware | 5f3e3c3 | 2014-03-19 14:46:25 -0500 | [diff] [blame] | 28 | Required for building 64-bit Debug and Release configuration builds |
| 29 | Visual Studio 2010 Premium Edition |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 30 | Required for building Release configuration builds that make use of |
Zachary Ware | 5f3e3c3 | 2014-03-19 14:46:25 -0500 | [diff] [blame] | 31 | Profile Guided Optimization (PGO), on either platform. |
| 32 | |
Zachary Ware | 4856a6a | 2014-06-13 09:38:50 -0500 | [diff] [blame] | 33 | Installing Service Pack 1 for Visual Studio 2010 is highly recommended |
| 34 | to avoid LNK1123 errors. |
| 35 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 36 | All you need to do to build is open the solution "pcbuild.sln" in Visual |
| 37 | Studio, select the desired combination of configuration and platform, |
| 38 | then build with "Build Solution" or the F7 keyboard shortcut. You can |
| 39 | also build from the command line using the "build.bat" script in this |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 40 | directory; see below for details. The solution is configured to build |
| 41 | the projects in the correct order. |
Guido van Rossum | 15b239f | 1998-05-26 14:16:23 +0000 | [diff] [blame] | 42 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 43 | The solution currently supports two platforms. The Win32 platform is |
| 44 | used to build standard x86-compatible 32-bit binaries, output into this |
| 45 | directory. The x64 platform is used for building 64-bit AMD64 (aka |
| 46 | x86_64 or EM64T) binaries, output into the amd64 sub-directory which |
| 47 | will be created if it doesn't already exist. The Itanium (IA-64) |
| 48 | platform is no longer supported. See the "Building for AMD64" section |
| 49 | below for more information about 64-bit builds. |
Guido van Rossum | 15b239f | 1998-05-26 14:16:23 +0000 | [diff] [blame] | 50 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 51 | Four configuration options are supported by the solution: |
| 52 | Debug |
| 53 | Used to build Python with extra debugging capabilities, equivalent |
| 54 | to using ./configure --with-pydebug on UNIX. All binaries built |
| 55 | using this configuration have "_d" added to their name: |
Zachary Ware | 6373ba5 | 2014-03-17 15:57:38 -0500 | [diff] [blame] | 56 | python35_d.dll, python_d.exe, parser_d.pyd, and so on. Both the |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 57 | build and rt (run test) batch files in this directory accept a -d |
| 58 | option for debug builds. If you are building Python to help with |
| 59 | development of CPython, you will most likely use this configuration. |
| 60 | PGInstrument, PGUpdate |
| 61 | Used to build Python in Release configuration using PGO, which |
Zachary Ware | 2170b14 | 2014-07-07 14:31:34 -0500 | [diff] [blame] | 62 | requires Premium Edition of Visual Studio. See the "Profile |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 63 | Guided Optimization" section below for more information. Build |
| 64 | output from each of these configurations lands in its own |
| 65 | sub-directory of this directory. The official Python releases are |
| 66 | built using these configurations. |
| 67 | Release |
| 68 | Used to build Python as it is meant to be used in production |
| 69 | settings, though without PGO. |
Guido van Rossum | 15b239f | 1998-05-26 14:16:23 +0000 | [diff] [blame] | 70 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 71 | |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 72 | Building Python using the build.bat script |
| 73 | ---------------------------------------------- |
| 74 | |
| 75 | In this directory you can find build.bat, a script designed to make |
| 76 | building Python on Windows simpler. The only absolute requirement for |
| 77 | using this script is for the VS100COMNTOOLS environment variable to be |
| 78 | properly set, which should be done by Microsoft Visual C++ 2010 |
| 79 | installation. |
| 80 | |
| 81 | By default, build.bat will build Python in Release configuration for |
| 82 | the 32-bit Win32 platform. It accepts several arguments to change |
| 83 | this behavior: |
| 84 | |
| 85 | -c <configuration> Set the configuration (see above) |
| 86 | -d Shortcut for "-c Debug" |
| 87 | -p <platform> Set the platform to build for ("Win32" or "x64") |
| 88 | -r Rebuild instead of just building |
| 89 | -e Use get_externals.bat to fetch external sources |
| 90 | |
| 91 | |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 92 | Legacy support |
| 93 | -------------- |
| 94 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 95 | You can find build directories for older versions of Visual Studio and |
| 96 | Visual C++ in the PC directory. The legacy build directories are no |
| 97 | longer actively maintained and may not work out of the box. |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 98 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 99 | Currently, the only legacy build directory is PC\VS9.0, for Visual |
| 100 | Studio 2008 (9.0). |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 101 | |
| 102 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 103 | C Runtime |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 104 | --------- |
| 105 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 106 | Visual Studio 2010 uses version 10 of the C runtime (MSVCRT10). The |
| 107 | executables no longer use the "Side by Side" assemblies used in previous |
| 108 | versions of the compiler. This simplifies distribution of applications. |
Christian Heimes | 57dddfb | 2008-01-02 18:30:52 +0000 | [diff] [blame] | 109 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 110 | The run time libraries are available under the VC/Redist folder of your |
| 111 | Visual Studio distribution. For more info, see the Readme in the |
| 112 | VC/Redist folder. |
Guido van Rossum | e79cf32 | 1998-07-07 22:35:03 +0000 | [diff] [blame] | 113 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 114 | |
| 115 | Sub-Projects |
| 116 | ------------ |
| 117 | |
| 118 | The CPython project is split up into several smaller sub-projects which |
| 119 | are managed by the pcbuild.sln solution file. Each sub-project is |
| 120 | represented by a .vcxproj and a .vcxproj.filters file starting with the |
| 121 | name of the sub-project. These sub-projects fall into a few general |
| 122 | categories: |
| 123 | |
| 124 | The following sub-projects represent the bare minimum required to build |
| 125 | a functioning CPython interpreter. If nothing else builds but these, |
| 126 | you'll have a very limited but usable python.exe: |
Tim Peters | 97c9640 | 2001-01-17 23:23:13 +0000 | [diff] [blame] | 127 | pythoncore |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 128 | .dll and .lib |
| 129 | python |
| 130 | .exe |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 131 | kill_python |
| 132 | kill_python.exe, a small program designed to kill any instances of |
| 133 | python(_d).exe that are running and live in the build output |
| 134 | directory; this is meant to avoid build issues due to locked files |
| 135 | make_buildinfo, make_versioninfo |
| 136 | helpers to provide necessary information to the build process |
| 137 | |
| 138 | These sub-projects provide extra executables that are useful for running |
| 139 | CPython in different ways: |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 140 | pythonw |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 141 | pythonw.exe, a variant of python.exe that doesn't open a Command |
| 142 | Prompt window |
| 143 | pylauncher |
| 144 | py.exe, the Python Launcher for Windows, see |
| 145 | http://docs.python.org/3/using/windows.html#launcher |
| 146 | pywlauncher |
| 147 | pyw.exe, a variant of py.exe that doesn't open a Command Prompt |
| 148 | window |
Zachary Ware | e0881f4 | 2013-11-05 21:55:46 -0600 | [diff] [blame] | 149 | _testembed |
| 150 | _testembed.exe, a small program that embeds Python for testing |
| 151 | purposes, used by test_capi.py |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 152 | |
| 153 | These are miscellaneous sub-projects that don't really fit the other |
| 154 | categories. By default, these projects do not build in Debug |
| 155 | configuration: |
| 156 | _freeze_importlib |
| 157 | _freeze_importlib.exe, used to regenerate Python\importlib.h after |
| 158 | changes have been made to Lib\importlib\_bootstrap.py |
| 159 | bdist_wininst |
| 160 | ..\Lib\distutils\command\wininst-10.0[-amd64].exe, the base |
| 161 | executable used by the distutils bdist_wininst command |
| 162 | python3dll |
| 163 | python3.dll, the PEP 384 Stable ABI dll |
| 164 | xxlimited |
| 165 | builds an example module that makes use of the PEP 384 Stable ABI, |
| 166 | see Modules\xxlimited.c |
| 167 | |
| 168 | The following sub-projects are for individual modules of the standard |
| 169 | library which are implemented in C; each one builds a DLL (renamed to |
| 170 | .pyd) of the same name as the project: |
| 171 | _ctypes |
| 172 | _ctypes_test |
| 173 | _decimal |
| 174 | _elementtree |
| 175 | _hashlib |
| 176 | _msi |
| 177 | _multiprocessing |
| 178 | _overlapped |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 179 | _socket |
Tim Peters | d66595f | 2001-02-04 03:09:53 +0000 | [diff] [blame] | 180 | _testcapi |
Stefan Krah | 9a2d99e | 2012-02-25 12:24:21 +0100 | [diff] [blame] | 181 | _testbuffer |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 182 | _testimportmultiple |
Tim Peters | b012a15 | 2002-02-13 23:56:46 +0000 | [diff] [blame] | 183 | pyexpat |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 184 | select |
Tim Peters | 19f52c2 | 2001-01-24 10:07:22 +0000 | [diff] [blame] | 185 | unicodedata |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 186 | winsound |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 187 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 188 | The following Python-controlled sub-projects wrap external projects. |
| 189 | Note that these external libraries are not necessary for a working |
| 190 | interpreter, but they do implement several major features. See the |
| 191 | "Getting External Sources" section below for additional information |
| 192 | about getting the source for building these libraries. The sub-projects |
| 193 | are: |
Antoine Pitrou | 37dc5f8 | 2011-04-03 17:05:46 +0200 | [diff] [blame] | 194 | _bz2 |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 195 | Python wrapper for version 1.0.6 of the libbzip2 compression library |
| 196 | Homepage: |
Antoine Pitrou | 37dc5f8 | 2011-04-03 17:05:46 +0200 | [diff] [blame] | 197 | http://www.bzip.org/ |
Nadeem Vawda | 3ff069e | 2011-11-30 00:25:06 +0200 | [diff] [blame] | 198 | _lzma |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 199 | Python wrapper for the liblzma compression library, using pre-built |
Martin v. Löwis | baacf4d | 2013-11-22 19:13:51 +0100 | [diff] [blame] | 200 | binaries of XZ Utils version 5.0.5 |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 201 | Homepage: |
| 202 | http://tukaani.org/xz/ |
Mark Hammond | f229f9f | 2002-12-03 05:47:26 +0000 | [diff] [blame] | 203 | _ssl |
Zachary Ware | 7d55da4 | 2014-06-06 01:23:53 -0500 | [diff] [blame] | 204 | Python wrapper for version 1.0.1h of the OpenSSL secure sockets |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 205 | library, which is built by ssl.vcxproj |
| 206 | Homepage: |
| 207 | http://www.openssl.org/ |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 208 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 209 | Building OpenSSL requires nasm.exe (the Netwide Assembler), version |
| 210 | 2.10 or newer from |
| 211 | http://www.nasm.us/ |
| 212 | to be somewhere on your PATH. More recent versions of OpenSSL may |
| 213 | need a later version of NASM. If OpenSSL's self tests don't pass, |
| 214 | you should first try to update NASM and do a full rebuild of |
| 215 | OpenSSL. |
Mark Hammond | f229f9f | 2002-12-03 05:47:26 +0000 | [diff] [blame] | 216 | |
Zachary Ware | 10c2dba | 2014-05-09 09:07:50 -0500 | [diff] [blame] | 217 | The ssl sub-project expects your OpenSSL sources to have already |
| 218 | been configured and be ready to build. If you get your sources |
| 219 | from svn.python.org as suggested in the "Getting External Sources" |
| 220 | section below, the OpenSSL source will already be ready to go. If |
| 221 | you want to build a different version, you will need to run |
| 222 | |
| 223 | PCbuild\prepare_ssl.py path\to\openssl-source-dir |
| 224 | |
| 225 | That script will prepare your OpenSSL sources in the same way that |
| 226 | those available on svn.python.org have been prepared. Note that |
| 227 | Perl must be installed and available on your PATH to configure |
| 228 | OpenSSL. ActivePerl is recommended and is available from |
Hirokazu Yamamoto | 7c3d709 | 2010-10-28 17:57:25 +0000 | [diff] [blame] | 229 | http://www.activestate.com/activeperl/ |
Mark Hammond | f229f9f | 2002-12-03 05:47:26 +0000 | [diff] [blame] | 230 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 231 | The ssl sub-project does not have the ability to clean the OpenSSL |
| 232 | build; if you need to rebuild, you'll have to clean it by hand. |
| 233 | _sqlite3 |
Martin v. Löwis | 09257f7 | 2014-03-02 19:42:50 +0100 | [diff] [blame] | 234 | Wraps SQLite 3.8.3.1, which is itself built by sqlite3.vcxproj |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 235 | Homepage: |
| 236 | http://www.sqlite.org/ |
| 237 | _tkinter |
Martin v. Löwis | 8d0d369 | 2013-11-23 23:05:27 +0100 | [diff] [blame] | 238 | Wraps version 8.6.1 of the Tk windowing system. |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 239 | Homepage: |
| 240 | http://www.tcl.tk/ |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 241 | |
Zachary Ware | a191b91 | 2014-03-21 22:58:19 -0500 | [diff] [blame] | 242 | Tkinter's dependencies are built by the tcl.vcxproj and tk.vcxproj |
| 243 | projects. The tix.vcxproj project also builds the Tix extended |
| 244 | widget set for use with Tkinter. |
| 245 | |
| 246 | Those three projects install their respective components in a |
| 247 | directory alongside the source directories called "tcltk" on |
| 248 | Win32 and "tcltk64" on x64. They also copy the Tcl and Tk DLLs |
| 249 | into the current output directory, which should ensure that Tkinter |
| 250 | is able to load Tcl/Tk without having to change your PATH. |
| 251 | |
| 252 | The tcl, tk, and tix sub-projects do not have the ability to clean |
| 253 | their builds; if you need to rebuild, you'll have to clean them by |
| 254 | hand. |
Trent Nelson | 5203727 | 2008-04-02 15:06:49 +0000 | [diff] [blame] | 255 | |
Trent Nelson | 5203727 | 2008-04-02 15:06:49 +0000 | [diff] [blame] | 256 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 257 | Getting External Sources |
| 258 | ------------------------ |
| 259 | |
| 260 | The last category of sub-projects listed above wrap external projects |
| 261 | Python doesn't control, and as such a little more work is required in |
| 262 | order to download the relevant source files for each project before they |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 263 | can be built. However, a simple script is provided to make this as |
| 264 | painless as possible, called "get_externals.bat" and located in this |
| 265 | directory. This script extracts all the external sub-projects from |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 266 | http://svn.python.org/projects/external |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 267 | via Subversion (so you'll need svn.exe on your PATH) and places them |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 268 | in ..\.. (relative to this directory). |
| 269 | |
| 270 | It is also possible to download sources from each project's homepage, |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 271 | though you may have to change folder names or pass the names to MSBuild |
| 272 | as the values of certain properties in order for the build solution to |
| 273 | find them. This is an advanced topic and not necessarily fully |
| 274 | supported. |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 275 | |
Martin v. Löwis | 13e50fe | 2004-07-20 14:37:48 +0000 | [diff] [blame] | 276 | |
Martin v. Löwis | 856bf9a | 2006-02-14 20:42:55 +0000 | [diff] [blame] | 277 | Building for AMD64 |
| 278 | ------------------ |
| 279 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 280 | The build process for AMD64 / x64 is very similar to standard builds, |
| 281 | you just have to set x64 as platform. In addition, the HOST_PYTHON |
| 282 | environment variable must point to a Python interpreter (at least 2.4), |
| 283 | to support cross-compilation from Win32. Note that Visual Studio |
Zachary Ware | e08f376 | 2014-03-28 23:31:04 -0500 | [diff] [blame] | 284 | requires Professional Edition or better in order to build 64-bit |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 285 | binaries. |
Martin v. Löwis | 856bf9a | 2006-02-14 20:42:55 +0000 | [diff] [blame] | 286 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 287 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 288 | Profile Guided Optimization |
| 289 | --------------------------- |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 290 | |
Christian Heimes | 25bb783 | 2008-01-11 16:17:00 +0000 | [diff] [blame] | 291 | The solution has two configurations for PGO. The PGInstrument |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 292 | configuration must be built first. The PGInstrument binaries are linked |
| 293 | against a profiling library and contain extra debug information. The |
| 294 | PGUpdate configuration takes the profiling data and generates optimized |
| 295 | binaries. |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 296 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 297 | The build_pgo.bat script automates the creation of optimized binaries. |
| 298 | It creates the PGI files, runs the unit test suite or PyBench with the |
| 299 | PGI python, and finally creates the optimized files. |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 300 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 301 | See |
| 302 | http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.100).aspx |
| 303 | for more on this topic. |
| 304 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 305 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 306 | Static library |
| 307 | -------------- |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 308 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 309 | The solution has no configuration for static libraries. However it is |
| 310 | easy to build a static library instead of a DLL. You simply have to set |
| 311 | the "Configuration Type" to "Static Library (.lib)" and alter the |
| 312 | preprocessor macro "Py_ENABLE_SHARED" to "Py_NO_ENABLE_SHARED". You may |
| 313 | also have to change the "Runtime Library" from "Multi-threaded DLL |
| 314 | (/MD)" to "Multi-threaded (/MT)". |
| 315 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 316 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 317 | Visual Studio properties |
| 318 | ------------------------ |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 319 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 320 | The PCbuild solution makes heavy use of Visual Studio property files |
| 321 | (*.props). The properties can be viewed and altered in the Property |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 322 | Manager (View -> Other Windows -> Property Manager). |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 323 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 324 | The property files used are (+-- = "also imports"): |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 325 | * debug (debug macro: _DEBUG) |
| 326 | * pginstrument (PGO) |
| 327 | * pgupdate (PGO) |
| 328 | +-- pginstrument |
| 329 | * pyd (python extension, release build) |
| 330 | +-- release |
| 331 | +-- pyproject |
| 332 | * pyd_d (python extension, debug build) |
| 333 | +-- debug |
| 334 | +-- pyproject |
| 335 | * pyproject (base settings for all projects, user macros like PyDllName) |
| 336 | * release (release macro: NDEBUG) |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 337 | * sqlite3 (used only by sqlite3.vcxproj) |
Zachary Ware | 4b87dc6 | 2014-03-28 23:36:43 -0500 | [diff] [blame] | 338 | * tcltk (used by _tkinter, tcl, tk and tix projects) |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 339 | * x64 (AMD64 / x64 platform specific settings) |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 340 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 341 | The pyproject property file defines _WIN32 and x64 defines _WIN64 and |
| 342 | _M_X64 although the macros are set by the compiler, too. The GUI doesn't |
| 343 | always know about the macros and confuse the user with false |
| 344 | information. |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 345 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 346 | |
| 347 | Your Own Extension DLLs |
Tim Peters | 4b5fb07 | 2000-07-01 00:03:43 +0000 | [diff] [blame] | 348 | ----------------------- |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 349 | |
Tim Golden | 7d05236 | 2013-10-25 08:58:16 +0100 | [diff] [blame] | 350 | If you want to create your own extension module DLL (.pyd), there's an |
| 351 | example with easy-to-follow instructions in ..\PC\example\; read the |
| 352 | file readme.txt there first. |