]> granicus.if.org Git - python/commitdiff
Generate getbuildinfo.o each time the linker is invoked;
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Jan 2006 09:13:51 +0000 (09:13 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Jan 2006 09:13:51 +0000 (09:13 +0000)
try to generate SVNVERSION information if subwcrev.exe
can be found.

Modules/getbuildinfo.c
PCbuild/make_buildinfo.vcproj [new file with mode: 0644]
PCbuild/pcbuild.sln
PCbuild/pythoncore.vcproj

index 7b47aea7e489cd7ceed47f59e1b1b8f7941b2f85..a017dab062acb3517a19d4c7d81fb3e92d5e284b 100644 (file)
 #endif
 #endif
 
+#ifdef SUBWCREV
+#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
+#endif
+
 const char *
 Py_GetBuildInfo(void)
 {
diff --git a/PCbuild/make_buildinfo.vcproj b/PCbuild/make_buildinfo.vcproj
new file mode 100644 (file)
index 0000000..d0c8a5d
--- /dev/null
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="windows-1250"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="make_buildinfo"\r
+       ProjectGUID="{C73F0EC1-358B-4177-940F-0846AC8B04CD}"\r
+       Keyword="Win32Proj">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="."\r
+                       IntermediateDirectory=".\x86-temp-release\make_buildinfo"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="TRUE"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="5"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/make_buildinfo.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/make_buildinfo.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="."\r
+                       IntermediateDirectory=".\x86-temp-release\make_buildinfo"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="4"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="3"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/make_buildinfo.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="TRUE"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">\r
+                       <File\r
+                               RelativePath=".\make_buildinfo.c">\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 8f998c3697c91d501031e42eaef66f4e9ca10c1a..7ccab0aabb6046dde6478848be0a09c467244529 100644 (file)
@@ -48,6 +48,7 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E}\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD} = {C73F0EC1-358B-4177-940F-0846AC8B04CD}\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"\r
@@ -79,6 +80,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtre
                {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfiguration) = preSolution\r
                Debug = Debug\r
@@ -181,8 +186,15 @@ Global
                {1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.Release.Build.0 = Release|Win32\r
                {1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium.ActiveCfg = ReleaseItanium|Win32\r
                {1966DDE2-4AB7-4E4E-ACC9-C121E4D37F8E}.ReleaseItanium.Build.0 = ReleaseItanium|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug.ActiveCfg = Debug|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug.Build.0 = Debug|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release.ActiveCfg = Release|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release.Build.0 = Release|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium.ActiveCfg = Release|Win32\r
+               {C73F0EC1-358B-4177-940F-0846AC8B04CD}.ReleaseItanium.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionItems) = postSolution\r
+               ..\Modules\getbuildinfo.c = ..\Modules\getbuildinfo.c\r
                readme.txt = readme.txt\r
        EndGlobalSection\r
        GlobalSection(ExtensibilityGlobals) = postSolution\r
index cc56ca2aa2ad46007a23aeb8ceb1b501fd5a494f..88ddf1abf4cc4eac7ceae34c91fd6215b5e67e1b 100644 (file)
@@ -4,6 +4,7 @@
        Version="7.10"
        Name="pythoncore"
        ProjectGUID="{7AFA1F0B-A8A1-455A-A832-BF263404BBEF}"
+       RootNamespace="pythoncore"
        SccProjectName="pythoncore"
        SccLocalPath="..">
        <Platforms>
@@ -37,6 +38,7 @@
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLinkerTool"
+                               AdditionalDependencies="getbuildinfo.o"
                                OutputFile="./python25.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="TRUE"
@@ -54,7 +56,9 @@
                        <Tool
                                Name="VCPreBuildEventTool"/>
                        <Tool
-                               Name="VCPreLinkEventTool"/>
+                               Name="VCPreLinkEventTool"
+                               Description="generate buildinfo"
+                               CommandLine="make_buildinfo.exe ${ConfigurationName}"/>
                        <Tool
                                Name="VCResourceCompilerTool"
                                PreprocessorDefinitions="NDEBUG"
@@ -94,6 +98,7 @@
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLinkerTool"
+                               AdditionalDependencies="getbuildinfo.o"
                                OutputFile="./python25_d.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="TRUE"
                        <Tool
                                Name="VCPreBuildEventTool"/>
                        <Tool
-                               Name="VCPreLinkEventTool"/>
+                               Name="VCPreLinkEventTool"
+                               Description="generate buildinfo"
+                               CommandLine="make_buildinfo.exe $(ConfigurationName)"/>
                        <Tool
                                Name="VCResourceCompilerTool"
                                PreprocessorDefinitions="_DEBUG"
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK"
+                               AdditionalDependencies="getbuildinfo.o"
                                OutputFile="./python25.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="FALSE"
                        <Tool
                                Name="VCPreBuildEventTool"/>
                        <Tool
-                               Name="VCPreLinkEventTool"/>
+                               Name="VCPreLinkEventTool"
+                               Description="generate buildinfo"
+                               CommandLine="make_buildinfo.exe ${ConfigurationName}"/>
                        <Tool
                                Name="VCResourceCompilerTool"
                                PreprocessorDefinitions="NDEBUG"
                <File
                        RelativePath="..\Python\getargs.c">
                </File>
-               <File
-                       RelativePath="..\Modules\getbuildinfo.c">
-                       <FileConfiguration
-                               Name="Release|Win32">
-                               <Tool
-                                       Name="VCCLCompilerTool"
-                                       PreprocessorDefinitions="BUILD=\&quot;60\&quot;"/>
-                       </FileConfiguration>
-               </File>
                <File
                        RelativePath="..\Python\getcompiler.c">
                </File>