mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Several Windows related cleanups:
* Removed a #define from pyconfig.h. The macro was already defined a few lines higher. * Fixed path to tix in the build_tkinter.py script * Changed make_buildinfo.c to use versions of unlink and strcat which are considered safe by Windows (as suggested by MvL). * Removed two defines from pyproject.vsprops that are no longer required. Both are defined in pyconfig.h and make_buildinfo.c doesn't use the unsafe versions any more (as suggested by MvL). * Added some more information about PGO and the property files to PCbuild9/readme.txt. Are you fine with the changes, Martin?
This commit is contained in:
parent
0a5e54e732
commit
3d2f564d41
5 changed files with 29 additions and 23 deletions
|
@ -209,12 +209,6 @@ typedef int pid_t;
|
||||||
#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
|
#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))
|
||||||
#define Py_IS_FINITE(X) _finite(X)
|
#define Py_IS_FINITE(X) _finite(X)
|
||||||
|
|
||||||
/* Turn off warnings about deprecated C runtime functions in
|
|
||||||
VisualStudio .NET 2005 */
|
|
||||||
#if _MSC_VER >= 1400 && !defined _CRT_SECURE_NO_DEPRECATE
|
|
||||||
#define _CRT_SECURE_NO_DEPRECATE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
/* define some ANSI types that are not defined in earlier Win headers */
|
/* define some ANSI types that are not defined in earlier Win headers */
|
||||||
|
|
|
@ -14,7 +14,7 @@ par = os.path.pardir
|
||||||
|
|
||||||
TCL = "tcl8.4.16"
|
TCL = "tcl8.4.16"
|
||||||
TK = "tk8.4.16"
|
TK = "tk8.4.16"
|
||||||
TIX = "Tix8.4.0"
|
TIX = "tix-8.4.0"
|
||||||
#TIX = "Tix8.4.2"
|
#TIX = "Tix8.4.2"
|
||||||
ROOT = os.path.abspath(os.path.join(here, par, par))
|
ROOT = os.path.abspath(os.path.join(here, par, par))
|
||||||
NMAKE = "nmake /nologo "
|
NMAKE = "nmake /nologo "
|
||||||
|
@ -53,6 +53,7 @@ def build(platform, clean):
|
||||||
|
|
||||||
# TIX
|
# TIX
|
||||||
if True:
|
if True:
|
||||||
|
# python9.mak is available at http://svn.python.org
|
||||||
os.chdir(os.path.join(ROOT, TIX, "win"))
|
os.chdir(os.path.join(ROOT, TIX, "win"))
|
||||||
if clean:
|
if clean:
|
||||||
system(NMAKE + "/f python9.mak clean")
|
system(NMAKE + "/f python9.mak clean")
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define CMD_SIZE 500
|
||||||
|
|
||||||
/* This file creates the getbuildinfo.o object, by first
|
/* This file creates the getbuildinfo.o object, by first
|
||||||
invoking subwcrev.exe (if found), and then invoking cl.exe.
|
invoking subwcrev.exe (if found), and then invoking cl.exe.
|
||||||
As a side effect, it might generate PCBuild\getbuildinfo2.c
|
As a side effect, it might generate PCBuild\getbuildinfo2.c
|
||||||
|
@ -23,7 +25,7 @@ int make_buildinfo2()
|
||||||
{
|
{
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
HKEY hTortoise;
|
HKEY hTortoise;
|
||||||
char command[500];
|
char command[CMD_SIZE+1];
|
||||||
DWORD type, size;
|
DWORD type, size;
|
||||||
if (_stat(".svn", &st) < 0)
|
if (_stat(".svn", &st) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -40,11 +42,11 @@ int make_buildinfo2()
|
||||||
type != REG_SZ)
|
type != REG_SZ)
|
||||||
/* Registry corrupted */
|
/* Registry corrupted */
|
||||||
return 0;
|
return 0;
|
||||||
strcat(command, "bin\\subwcrev.exe");
|
strcat_s(command, CMD_SIZE, "bin\\subwcrev.exe");
|
||||||
if (_stat(command+1, &st) < 0)
|
if (_stat(command+1, &st) < 0)
|
||||||
/* subwcrev.exe not part of the release */
|
/* subwcrev.exe not part of the release */
|
||||||
return 0;
|
return 0;
|
||||||
strcat(command, "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
|
strcat_s(command, CMD_SIZE, "\" .. ..\\Modules\\getbuildinfo.c getbuildinfo2.c");
|
||||||
puts(command); fflush(stdout);
|
puts(command); fflush(stdout);
|
||||||
if (system(command) < 0)
|
if (system(command) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -60,17 +62,17 @@ int main(int argc, char*argv[])
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (strcmp(argv[1], "Release") == 0) {
|
if (strcmp(argv[1], "Release") == 0) {
|
||||||
strcat(command, "-MD ");
|
strcat_s(command, CMD_SIZE, "-MD ");
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "Debug") == 0) {
|
else if (strcmp(argv[1], "Debug") == 0) {
|
||||||
strcat(command, "-D_DEBUG -MDd ");
|
strcat_s(command, CMD_SIZE, "-D_DEBUG -MDd ");
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "ReleaseItanium") == 0) {
|
else if (strcmp(argv[1], "ReleaseItanium") == 0) {
|
||||||
strcat(command, "-MD /USECL:MS_ITANIUM ");
|
strcat_s(command, CMD_SIZE, "-MD /USECL:MS_ITANIUM ");
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
|
else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
|
||||||
strcat(command, "-MD ");
|
strcat_s(command, CMD_SIZE, "-MD ");
|
||||||
strcat(command, "-MD /USECL:MS_OPTERON ");
|
strcat_s(command, CMD_SIZE, "-MD /USECL:MS_OPTERON ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "unsupported configuration %s\n", argv[1]);
|
fprintf(stderr, "unsupported configuration %s\n", argv[1]);
|
||||||
|
@ -78,14 +80,14 @@ int main(int argc, char*argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((do_unlink = make_buildinfo2()))
|
if ((do_unlink = make_buildinfo2()))
|
||||||
strcat(command, "getbuildinfo2.c -DSUBWCREV ");
|
strcat_s(command, CMD_SIZE, "getbuildinfo2.c -DSUBWCREV ");
|
||||||
else
|
else
|
||||||
strcat(command, "..\\Modules\\getbuildinfo.c");
|
strcat_s(command, CMD_SIZE, "..\\Modules\\getbuildinfo.c");
|
||||||
strcat(command, " -Fogetbuildinfo.o -I..\\Include -I..\\PC");
|
strcat_s(command, CMD_SIZE, " -Fogetbuildinfo.o -I..\\Include -I..\\PC");
|
||||||
puts(command); fflush(stdout);
|
puts(command); fflush(stdout);
|
||||||
result = system(command);
|
result = system(command);
|
||||||
if (do_unlink)
|
if (do_unlink)
|
||||||
unlink("getbuildinfo2.c");
|
_unlink("getbuildinfo2.c");
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
AdditionalIncludeDirectories="..\Include; ..\PC"
|
AdditionalIncludeDirectories="..\Include; ..\PC"
|
||||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WIN32"
|
PreprocessorDefinitions="_WIN32"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="0"
|
ExceptionHandling="0"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
|
|
|
@ -281,6 +281,14 @@ Edition.
|
||||||
Profile Guided Optimization
|
Profile Guided Optimization
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
The solution has two configurations for PGO. The PGInstrument configuration
|
||||||
|
must be build first. The PGInstrument binaries are lniked against a profiling
|
||||||
|
library and contain extra debug information. The PGUpdate configuration takes the profiling data and generates optimized binaries.
|
||||||
|
|
||||||
|
The build_pgo.bat script automates the creation of optimized binaries. It
|
||||||
|
creates the PGI files, runs the unit test suite or PyBench with the PGI
|
||||||
|
python and finally creates the optimized files.
|
||||||
|
|
||||||
http://msdn2.microsoft.com/en-us/library/e7k32f4k(VS.90).aspx
|
http://msdn2.microsoft.com/en-us/library/e7k32f4k(VS.90).aspx
|
||||||
|
|
||||||
Static library
|
Static library
|
||||||
|
@ -300,7 +308,7 @@ The PCbuild9 solution makes heavy use of Visual Studio property files
|
||||||
(*.vsprops). The properties can be viewed and altered in the Property
|
(*.vsprops). The properties can be viewed and altered in the Property
|
||||||
Manager (View -> Other Windows -> Property Manager).
|
Manager (View -> Other Windows -> Property Manager).
|
||||||
|
|
||||||
* debug (debug macros)
|
* debug (debug macro: _DEBUG)
|
||||||
* pginstrument (PGO)
|
* pginstrument (PGO)
|
||||||
* pgupdate (PGO)
|
* pgupdate (PGO)
|
||||||
+-- pginstrument
|
+-- pginstrument
|
||||||
|
@ -310,8 +318,8 @@ Manager (View -> Other Windows -> Property Manager).
|
||||||
* pyd_d (python extension, debug build)
|
* pyd_d (python extension, debug build)
|
||||||
+-- debug
|
+-- debug
|
||||||
+-- pyproject
|
+-- pyproject
|
||||||
* pyproject (base settings for all projects)
|
* pyproject (base settings for all projects, user macros like PyDllName)
|
||||||
* release (release macros)
|
* release (release macro: NDEBUG)
|
||||||
* x64 (AMD64 / x64 platform specific settings)
|
* x64 (AMD64 / x64 platform specific settings)
|
||||||
|
|
||||||
The pyproject propertyfile defines _WIN32 and x64 defines _WIN64 and _M_X64
|
The pyproject propertyfile defines _WIN32 and x64 defines _WIN64 and _M_X64
|
||||||
|
@ -320,6 +328,7 @@ about the macros and confuse the user with false information.
|
||||||
|
|
||||||
YOUR OWN EXTENSION DLLs
|
YOUR OWN EXTENSION DLLs
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
If you want to create your own extension module DLL, there's an example
|
If you want to create your own extension module DLL, there's an example
|
||||||
with easy-to-follow instructions in ../PC/example/; read the file
|
with easy-to-follow instructions in ../PC/example/; read the file
|
||||||
readme.txt there first.
|
readme.txt there first.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue