summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/_msi.vcproj4
-rw-r--r--PCbuild/_ssl.vcproj18
-rw-r--r--PCbuild/build_ssl.bat10
-rw-r--r--PCbuild/build_ssl.py97
-rw-r--r--PCbuild/pythoncore.vcproj15
-rw-r--r--PCbuild/readme.txt13
6 files changed, 103 insertions, 54 deletions
diff --git a/PCbuild/_msi.vcproj b/PCbuild/_msi.vcproj
index fb8925e..b4afeb4 100644
--- a/PCbuild/_msi.vcproj
+++ b/PCbuild/_msi.vcproj
@@ -36,11 +36,11 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="fci.lib msi.lib rpcrt4.lib"
- OutputFile="./_msi.pyd"
+ OutputFile="./_msi_d.pyd"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\./_msi.pdb"
+ ProgramDatabaseFile=".\./_msi_d.pdb"
BaseAddress="0x1D160000"
ImportLibrary=".\./_msi.lib"
TargetMachine="1"/>
diff --git a/PCbuild/_ssl.vcproj b/PCbuild/_ssl.vcproj
index 3ebedbd..bc69ee8 100644
--- a/PCbuild/_ssl.vcproj
+++ b/PCbuild/_ssl.vcproj
@@ -21,8 +21,8 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="python build_ssl.py"
- ReBuildCommandLine="python build_ssl.py -a"
+ BuildCommandLine="build_ssl.bat $(ConfigurationName)"
+ ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"
CleanCommandLine="echo Nothing to do"
Output="_ssl.pyd"/>
</Configuration>
@@ -35,8 +35,8 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="python_d -u build_ssl.py -d"
- ReBuildCommandLine="python_d -u build_ssl.py -d -a"
+ BuildCommandLine="build_ssl.bat $(ConfigurationName)"
+ ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"
CleanCommandLine="echo Nothing to do"
Output="_ssl_d.pyd"/>
</Configuration>
@@ -49,8 +49,9 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="python build_ssl.py"
- ReBuildCommandLine="python build_ssl.py -a"
+ BuildCommandLine="build_ssl.bat $(ConfigurationName)"
+ ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"
+ CleanCommandLine="echo Nothing to do"
Output="_ssl.pyd"/>
</Configuration>
<Configuration
@@ -62,8 +63,9 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCNMakeTool"
- BuildCommandLine="python build_ssl.py"
- ReBuildCommandLine="python build_ssl.py -a"
+ BuildCommandLine="build_ssl.bat $(ConfigurationName)"
+ ReBuildCommandLine="build_ssl.bat $(ConfigurationName) -a"
+ CleanCommandLine="echo Nothing to do"
Output="_ssl.pyd"/>
</Configuration>
</Configurations>
diff --git a/PCbuild/build_ssl.bat b/PCbuild/build_ssl.bat
new file mode 100644
index 0000000..82572ed
--- /dev/null
+++ b/PCbuild/build_ssl.bat
@@ -0,0 +1,10 @@
+@echo off
+if not defined HOST_PYTHON (
+ if %1 EQU Debug (
+ set HOST_PYTHON=python_d.exe
+ ) ELSE (
+ set HOST_PYTHON=python.exe
+ )
+)
+%HOST_PYTHON% build_ssl.py %1 %2
+
diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py
index 8f485a2..d4beee5 100644
--- a/PCbuild/build_ssl.py
+++ b/PCbuild/build_ssl.py
@@ -84,9 +84,59 @@ def find_best_ssl_dir(sources):
print "Could not find an SSL directory in '%s'" % (sources,)
return best_name
+def run_32all_py():
+ # ms\32all.bat will reconfigure OpenSSL and then try to build
+ # all outputs (debug/nondebug/dll/lib). So we filter the file
+ # to exclude any "nmake" commands and then execute.
+ tempname = "ms\\32all_py.bat"
+
+ in_bat = open("ms\\32all.bat")
+ temp_bat = open(tempname,"w")
+ while 1:
+ cmd = in_bat.readline()
+ print 'cmd', repr(cmd)
+ if not cmd: break
+ if cmd.strip()[:5].lower() == "nmake":
+ continue
+ temp_bat.write(cmd)
+ in_bat.close()
+ temp_bat.close()
+ os.system(tempname)
+ try:
+ os.remove(tempname)
+ except:
+ pass
+
+def run_configure(configure, do_script):
+ os.system("perl Configure "+configure)
+ os.system(do_script)
+
def main():
- debug = "-d" in sys.argv
build_all = "-a" in sys.argv
+ if sys.argv[1] == "Release":
+ arch = "x86"
+ debug = False
+ configure = "VC-WIN32"
+ makefile = "32.mak"
+ elif sys.argv[1] == "Debug":
+ arch = "x86"
+ debug = True
+ configure = "VC-WIN32"
+ makefile="d32.mak"
+ elif sys.argv[1] == "ReleaseItanium":
+ arch = "ia64"
+ debug = False
+ configure = "VC-WIN64I"
+ do_script = "ms\\do_win64i"
+ makefile = "ms\\nt.mak"
+ os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM"
+ elif sys.argv[1] == "ReleaseAMD64":
+ arch="amd64"
+ debug=False
+ configure = "VC-WIN64A"
+ do_script = "ms\\do_win64a"
+ makefile = "ms\\nt.mak"
+ os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON"
make_flags = ""
if build_all:
make_flags = "-a"
@@ -107,49 +157,24 @@ def main():
try:
os.chdir(ssl_dir)
# If the ssl makefiles do not exist, we invoke Perl to generate them.
- if not os.path.isfile(os.path.join(ssl_dir, "32.mak")) or \
- not os.path.isfile(os.path.join(ssl_dir, "d32.mak")):
+ if not os.path.isfile(makefile):
print "Creating the makefiles..."
# Put our working Perl at the front of our path
os.environ["PATH"] = os.path.split(perl)[0] + \
os.pathsep + \
os.environ["PATH"]
- # ms\32all.bat will reconfigure OpenSSL and then try to build
- # all outputs (debug/nondebug/dll/lib). So we filter the file
- # to exclude any "nmake" commands and then execute.
- tempname = "ms\\32all_py.bat"
-
- in_bat = open("ms\\32all.bat")
- temp_bat = open(tempname,"w")
- while 1:
- cmd = in_bat.readline()
- print 'cmd', repr(cmd)
- if not cmd: break
- if cmd.strip()[:5].lower() == "nmake":
- continue
- temp_bat.write(cmd)
- in_bat.close()
- temp_bat.close()
- os.system(tempname)
- try:
- os.remove(tempname)
- except:
- pass
+ if arch=="x86":
+ run_32all_py()
+ else:
+ run_configure(configure, do_script)
# Now run make.
print "Executing nmake over the ssl makefiles..."
- if debug:
- rc = os.system("nmake /nologo -f d32.mak")
- if rc:
- print "Executing d32.mak failed"
- print rc
- sys.exit(rc)
- else:
- rc = os.system("nmake /nologo -f 32.mak")
- if rc:
- print "Executing 32.mak failed"
- print rc
- sys.exit(rc)
+ rc = os.system("nmake /nologo -f "+makefile)
+ if rc:
+ print "Executing d32.mak failed"
+ print rc
+ sys.exit(rc)
finally:
os.chdir(old_cd)
# And finally, we can build the _ssl module itself for Python.
diff --git a/PCbuild/pythoncore.vcproj b/PCbuild/pythoncore.vcproj
index bb9f7af..ef200c4 100644
--- a/PCbuild/pythoncore.vcproj
+++ b/PCbuild/pythoncore.vcproj
@@ -344,9 +344,6 @@
RelativePath="..\Modules\_bisectmodule.c">
</File>
<File
- RelativePath="..\Modules\_struct.c">
- </File>
- <File
RelativePath="..\Modules\cjkcodecs\_codecs_cn.c">
</File>
<File
@@ -371,6 +368,9 @@
RelativePath="..\Modules\_csv.c">
</File>
<File
+ RelativePath="..\Modules\_functoolsmodule.c">
+ </File>
+ <File
RelativePath="..\Modules\_heapqmodule.c">
</File>
<File
@@ -389,9 +389,15 @@
RelativePath="..\Modules\_sre.c">
</File>
<File
+ RelativePath="..\Modules\_struct.c">
+ </File>
+ <File
RelativePath="..\Pc\_subprocess.c">
</File>
<File
+ RelativePath="..\Modules\_typesmodule.c">
+ </File>
+ <File
RelativePath="..\Modules\_weakref.c">
</File>
<File
@@ -515,9 +521,6 @@
RelativePath="..\Objects\funcobject.c">
</File>
<File
- RelativePath="..\Modules\_functoolsmodule.c">
- </File>
- <File
RelativePath="..\Python\future.c">
</File>
<File
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index 184d11f..4536368 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -264,7 +264,7 @@ SDK, in particular the 64-bit support. This includes an Itanium compiler
In addition, you need the Visual Studio plugin for external C compilers,
from http://sf.net/projects/vsextcomp. The plugin will wrap cl.exe, to
locate the proper target compiler, and convert compiler options
-accordingly. The project files require atleast version 0.8.
+accordingly. The project files require atleast version 0.9.
Building for AMD64
------------------
@@ -280,12 +280,21 @@ The build process for Visual C++ can be used almost unchanged with the free MS
Toolkit Compiler. This provides a way of building Python using freely
available software.
+Note that Microsoft have withdrawn the free MS Toolkit Compiler, so this can
+no longer be considered a supported option. The instructions are still
+correct, but you need to already have a copy of the compiler in order to use
+them. Microsoft now supply Visual C++ 2005 Express Edition for free, but this
+is NOT compatible with Visual C++ 7.1 (it uses a different C runtime), and so
+cannot be used to build a version of Python compatible with the standard
+python.org build. If you are interested in using Visual C++ 2005 Express
+Edition, however, you should look at the PCBuild8 directory.
+
Requirements
To build Python, the following tools are required:
* The Visual C++ Toolkit Compiler
- from http://msdn.microsoft.com/visualc/vctoolkit2003/
+ no longer available for download - see above
* A recent Platform SDK
from http://www.microsoft.com/downloads/details.aspx?FamilyID=484269e2-3b89-47e3-8eb7-1f2be6d7123a
* The .NET 1.1 SDK