Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ee89cf

Browse files
author
Hirokazu Yamamoto
committed
Updated PC/VS8.0. (mainly to follow r86137: use temporary dir in make_buildinfo.c)
1 parent 9794a26 commit 5ee89cf

4 files changed

Lines changed: 120 additions & 95 deletions

File tree

PC/VS8.0/bz2.vcproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<Tool
4444
Name="VCCLCompilerTool"
4545
AdditionalIncludeDirectories="$(bz2Dir)"
46-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
46+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
4747
/>
4848
<Tool
4949
Name="VCManagedResourceCompilerTool"
@@ -105,7 +105,7 @@
105105
<Tool
106106
Name="VCCLCompilerTool"
107107
AdditionalIncludeDirectories="$(bz2Dir)"
108-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
108+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
109109
/>
110110
<Tool
111111
Name="VCManagedResourceCompilerTool"
@@ -167,7 +167,7 @@
167167
<Tool
168168
Name="VCCLCompilerTool"
169169
AdditionalIncludeDirectories="$(bz2Dir)"
170-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
170+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
171171
/>
172172
<Tool
173173
Name="VCManagedResourceCompilerTool"
@@ -230,7 +230,7 @@
230230
<Tool
231231
Name="VCCLCompilerTool"
232232
AdditionalIncludeDirectories="$(bz2Dir)"
233-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
233+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
234234
/>
235235
<Tool
236236
Name="VCManagedResourceCompilerTool"
@@ -292,7 +292,7 @@
292292
<Tool
293293
Name="VCCLCompilerTool"
294294
AdditionalIncludeDirectories="$(bz2Dir)"
295-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
295+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
296296
/>
297297
<Tool
298298
Name="VCManagedResourceCompilerTool"
@@ -355,7 +355,7 @@
355355
<Tool
356356
Name="VCCLCompilerTool"
357357
AdditionalIncludeDirectories="$(bz2Dir)"
358-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
358+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
359359
/>
360360
<Tool
361361
Name="VCManagedResourceCompilerTool"
@@ -418,7 +418,7 @@
418418
<Tool
419419
Name="VCCLCompilerTool"
420420
AdditionalIncludeDirectories="$(bz2Dir)"
421-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
421+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
422422
/>
423423
<Tool
424424
Name="VCManagedResourceCompilerTool"
@@ -481,7 +481,7 @@
481481
<Tool
482482
Name="VCCLCompilerTool"
483483
AdditionalIncludeDirectories="$(bz2Dir)"
484-
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64"
484+
PreprocessorDefinitions="WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
485485
/>
486486
<Tool
487487
Name="VCManagedResourceCompilerTool"

PC/VS8.0/make_buildinfo.c

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@
1919
invoked as a pre-link step for pythoncore, so that overwrites
2020
any previous getbuildinfo.o.
2121
22+
However, if a second argument is provided, this will be used
23+
as a temporary directory where any getbuildinfo2.c and
24+
getbuildinfo.o files are put. This is useful if multiple
25+
configurations are being built in parallel, to avoid them
26+
trampling each other's files.
27+
2228
*/
2329

24-
int make_buildinfo2()
30+
int make_buildinfo2(const char *tmppath)
2531
{
2632
struct _stat st;
2733
HKEY hTortoise;
@@ -46,7 +52,9 @@ int make_buildinfo2()
4652
if (_stat(command+1, &st) < 0)
4753
/* subwcrev.exe not part of the release */
4854
return 0;
49-
strcat_s(command, CMD_SIZE, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c getbuildinfo2.c");
55+
strcat_s(command, CMD_SIZE, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c ");
56+
strcat_s(command, CMD_SIZE, tmppath);
57+
strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
5058
puts(command); fflush(stdout);
5159
if (system(command) < 0)
5260
return 0;
@@ -55,10 +63,12 @@ int make_buildinfo2()
5563

5664
int main(int argc, char*argv[])
5765
{
58-
char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
66+
char command[CMD_SIZE] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
67+
char tmppath[CMD_SIZE] = "";
5968
int do_unlink, result;
60-
if (argc != 2) {
61-
fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
69+
char *tmpdir = NULL;
70+
if (argc <= 2 || argc > 3) {
71+
fprintf(stderr, "make_buildinfo $(ConfigurationName) [tmpdir]\n");
6272
return EXIT_FAILURE;
6373
}
6474
if (strcmp(argv[1], "Release") == 0) {
@@ -78,16 +88,28 @@ int main(int argc, char*argv[])
7888
fprintf(stderr, "unsupported configuration %s\n", argv[1]);
7989
return EXIT_FAILURE;
8090
}
91+
if (argc > 2) {
92+
tmpdir = argv[2];
93+
strcat_s(tmppath, _countof(tmppath), tmpdir);
94+
strcat_s(tmppath, _countof(tmppath), "\\");
95+
}
8196

82-
if ((do_unlink = make_buildinfo2()))
97+
if ((do_unlink = make_buildinfo2(tmppath))) {
98+
strcat_s(command, CMD_SIZE, tmppath);
8399
strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV ");
84-
else
100+
} else
85101
strcat_s(command, CMD_SIZE, "..\\..\\Modules\\getbuildinfo.c");
86-
strcat_s(command, CMD_SIZE, " -Fogetbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
102+
strcat_s(command, CMD_SIZE, " -Fo");
103+
strcat_s(command, CMD_SIZE, tmppath);
104+
strcat_s(command, CMD_SIZE, "getbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
87105
puts(command); fflush(stdout);
88106
result = system(command);
89-
if (do_unlink)
90-
_unlink("getbuildinfo2.c");
107+
if (do_unlink) {
108+
command[0] = '\0';
109+
strcat_s(command, CMD_SIZE, tmppath);
110+
strcat_s(command, CMD_SIZE, "getbuildinfo2.c");
111+
_unlink(command);
112+
}
91113
if (result < 0)
92114
return EXIT_FAILURE;
93115
return 0;

PC/VS8.0/make_buildinfo.vcproj

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
<Platform
1313
Name="Win32"
1414
/>
15-
<Platform
16-
Name="x64"
17-
/>
1815
</Platforms>
1916
<ToolFiles>
2017
</ToolFiles>
@@ -84,64 +81,6 @@
8481
Name="VCPostBuildEventTool"
8582
/>
8683
</Configuration>
87-
<Configuration
88-
Name="Release|x64"
89-
ConfigurationType="1"
90-
InheritedPropertySheets=".\pyproject.vsprops;.\x64.vsprops;.\release.vsprops"
91-
>
92-
<Tool
93-
Name="VCPreBuildEventTool"
94-
/>
95-
<Tool
96-
Name="VCCustomBuildTool"
97-
/>
98-
<Tool
99-
Name="VCXMLDataGeneratorTool"
100-
/>
101-
<Tool
102-
Name="VCWebServiceProxyGeneratorTool"
103-
/>
104-
<Tool
105-
Name="VCMIDLTool"
106-
/>
107-
<Tool
108-
Name="VCCLCompilerTool"
109-
PreprocessorDefinitions="_CONSOLE"
110-
/>
111-
<Tool
112-
Name="VCManagedResourceCompilerTool"
113-
/>
114-
<Tool
115-
Name="VCResourceCompilerTool"
116-
/>
117-
<Tool
118-
Name="VCPreLinkEventTool"
119-
/>
120-
<Tool
121-
Name="VCLinkerTool"
122-
/>
123-
<Tool
124-
Name="VCALinkTool"
125-
/>
126-
<Tool
127-
Name="VCManifestTool"
128-
/>
129-
<Tool
130-
Name="VCXDCMakeTool"
131-
/>
132-
<Tool
133-
Name="VCBscMakeTool"
134-
/>
135-
<Tool
136-
Name="VCFxCopTool"
137-
/>
138-
<Tool
139-
Name="VCAppVerifierTool"
140-
/>
141-
<Tool
142-
Name="VCPostBuildEventTool"
143-
/>
144-
</Configuration>
14584
</Configurations>
14685
<References>
14786
</References>

0 commit comments

Comments
 (0)