cpython: de3e1c81ecd7 (original) (raw)

Mercurial > cpython

changeset 97867:de3e1c81ecd7 3.4

Issue #25022: Remove PC/example_nt/ It was very much outdated, and the topic is better covered elsewhere. [#25022]

Zachary Ware zachary.ware@gmail.com
date Thu, 10 Sep 2015 14:37:42 -0500
parents 5093d9151a18
children 2460fa584323 c535bf72aa60
files PC/example_nt/example.c PC/example_nt/example.sln PC/example_nt/example.vcproj PC/example_nt/readme.txt PC/example_nt/setup.py PC/readme.txt PCbuild/readme.txt
diffstat 7 files changed, 0 insertions(+), 457 deletions(-)[+] [-] PC/example_nt/example.c 32 PC/example_nt/example.sln 21 PC/example_nt/example.vcproj 189 PC/example_nt/readme.txt 183 PC/example_nt/setup.py 22 PC/readme.txt 2 PCbuild/readme.txt 8

line wrap: on

line diff

deleted file mode 100644 --- a/PC/example_nt/example.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "Python.h" - -static PyObject * -ex_foo(PyObject *self, PyObject *args) -{

-} - -static PyMethodDef example_methods[] = {

-}; - -static struct PyModuleDef examplemodule = {

-}; - -PyMODINIT_FUNC -PyInit_example(void) -{

-}

deleted file mode 100644 --- a/PC/example_nt/example.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example.vcproj", "{A0608D6F-84ED-44AE-A2A6-A3CC7F4A4030}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {A0608D6F-84ED-44AE-A2A6-A3CC7F4A4030}.Debug.ActiveCfg = Debug|Win32 - {A0608D6F-84ED-44AE-A2A6-A3CC7F4A4030}.Debug.Build.0 = Debug|Win32 - {A0608D6F-84ED-44AE-A2A6-A3CC7F4A4030}.Release.ActiveCfg = Release|Win32 - {A0608D6F-84ED-44AE-A2A6-A3CC7F4A4030}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal

deleted file mode 100644 --- a/PC/example_nt/example.vcproj +++ /dev/null @@ -1,189 +0,0 @@ - -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="example" - SccProjectName="" - SccLocalPath=""> - - <Platform - Name="Win32"/> - - - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="..\Include,..\PC" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" - StringPooling="TRUE" - RuntimeLibrary="2" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\Release/example.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalOptions="/export:initexample" - AdditionalDependencies="odbc32.lib odbccp32.lib python34.lib" - OutputFile=".\Release/example.pyd" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="..\PCbuild" - ModuleDefinitionFile="" - ProgramDatabaseFile=".\Release/example.pdb" - SubSystem="2" - ImportLibrary=".\Release/example.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\Release/example.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - - <Configuration - Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" - ConfigurationType="2" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\Include,..\PC" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" - RuntimeLibrary="3" - UsePrecompiledHeader="2" - PrecompiledHeaderFile=".\Debug/example.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="4" - CompileAs="0"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalOptions="/export:initexample" - AdditionalDependencies="odbc32.lib odbccp32.lib python34_d.lib" - OutputFile=".\Debug/example_d.pyd" - LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories="..\PCbuild" - ModuleDefinitionFile="" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\Debug/example_d.pdb" - SubSystem="2" - ImportLibrary=".\Debug/example_d.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="TRUE" - SuppressStartupBanner="TRUE" - TargetEnvironment="1" - TypeLibraryName=".\Debug/example.tlb" - HeaderFileName=""/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - - - - - - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"> - <File - RelativePath="example.c"> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/> - - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/> - - - - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;fi;fd"> - - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"> - - <File - RelativePath="readme.txt"> - - - - -

deleted file mode 100644 --- a/PC/example_nt/readme.txt +++ /dev/null @@ -1,183 +0,0 @@ -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++. -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: -

-dialog (not the "File -> Open..." dialog!). Navigate to and select the -file "example.sln", in the copy of the example_nt directory you made -above. -Click Open. - -BUILD THE EXAMPLE DLL ---------------------- -In order to check that everything is set up right, try building: - -1. Select a configuration. This step is optional. Do

-2. Build the DLL. Do

-TESTING THE DEBUG-MODE DLL --------------------------- -Once the Debug build has succeeded, bring up a DOS box, and cd to -example_nt\Debug. You should now be able to repeat the following session -("C>" is the DOS prompt, ">>>" is the Python prompt) (note that various -debug output from Python may not match this screen dump exactly): -

- -TESTING THE RELEASE-MODE DLL ----------------------------- -Once the Release build has succeeded, bring up a DOS box, and cd to -example_nt\Release. You should now be able to repeat the following session -("C>" is the DOS prompt, ">>>" is the Python prompt): -

- -Congratulations! You've successfully built your first Python extension -module. - -CREATING YOUR OWN PROJECT -------------------------- -Choose a name ("spam" is always a winner :-) and create a directory for -it. Copy your C sources into it. Note that the module source file name -does not necessarily have to match the module name, but the "init" function -name should match the module name -- i.e. you can only import a module -"spam" if its init function is called "initspam()", and it should call -Py_InitModule with the string "spam" as its first argument (use the minimal -example.c in this directory as a guide). By convention, it lives in a file -called "spam.c" or "spammodule.c". The output file should be called -"spam.dll" or "spam.pyd" (the latter is supported to avoid confusion with a -system library "spam.dll" to which your module could be a Python interface) -in Release mode, or spam_d.dll or spam_d.pyd in Debug mode. - -Now your options are: - -1) Copy example.sln and example.vcproj, rename them to spam.*, and edit them -by hand. - -or - -2) Create a brand new project; instructions are below. - -In either case, copy example_nt\example.def to spam\spam.def, and edit the -new spam.def so its second line contains the string "initspam". If you -created a new project yourself, add the file spam.def to the project now. -(This is an annoying little file with only two lines. An alternative -approach is to forget about the .def file, and add the option -"/export:initspam" somewhere to the Link settings, by manually editing the -"Project -> Properties -> Linker -> Command Line -> Additional Options" -box). - -You are now all set to build your extension, unless it requires other -external libraries, include files, etc. See Python's Extending and -Embedding manual for instructions on how to write an extension. - - -CREATING A BRAND NEW PROJECT ----------------------------- -Use the

-dialog to create a new Project Workspace. Select "Visual C++ Projects/Win32/ -Win32 Project", enter the name ("spam"), and make sure the "Location" is -set to parent of the spam directory you have created (which should be a direct -subdirectory of the Python build tree, a sibling of Include and PC). -In "Application Settings", select "DLL", and "Empty Project". Click OK. - -You should now create the file spam.def as instructed in the previous -section. Add the source files (including the .def file) to the project, -using "Project", "Add Existing Item". - -Now open the

-dialog. (Impressive, isn't it? :-) You only need to change a few -settings. Make sure "All Configurations" is selected from the "Settings -for:" dropdown list. Select the "C/C++" tab. Choose the "General" -category in the popup menu at the top. Type the following text in the -entry box labeled "Addditional Include Directories:" -

- -Then, choose the "General" category in the "Linker" tab, and enter

-in the "Additional library Directories" box. - -Now you need to add some mode-specific settings (select "Accept" -when asked to confirm your changes): - -Select "Release" in the "Configuration" dropdown list. Click the -"Link" tab, choose the "Input" Category, and append "python24.lib" to the -list in the "Additional Dependencies" box. - -Select "Debug" in the "Settings for:" dropdown list, and append -"python24_d.lib" to the list in the Additional Dependencies" box. Then -click on the C/C++ tab, select "Code Generation", and select -"Multi-threaded Debug DLL" from the "Runtime library" dropdown list. - -Select "Release" again from the "Settings for:" dropdown list. -Select "Multi-threaded DLL" from the "Use run-time library:" dropdown list. - -That's all .

deleted file mode 100644 --- a/PC/example_nt/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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",

-)

--- a/PC/readme.txt +++ b/PC/readme.txt @@ -71,8 +71,6 @@ getpathp.c Default sys.path calculat dllbase_nt.txt A (manually maintained) list of base addresses for various DLLs, to avoid run-time relocation. -example_nt A subdirectory showing how to build an extension as a

Legacy support for older versions of Visual Studio ==================================================

--- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -312,11 +312,3 @@ The pyproject property file defines _WIN _M_X64 although the macros are set by the compiler, too. The GUI doesn't always know about the macros and confuse the user with false information. - - -Your Own Extension DLLs ------------------------ - -If you want to create your own extension module DLL (.pyd), there's an -example with easy-to-follow instructions in ..\PC\example_nt; read the -file readme.txt there first.