Extend build_ssl to Win64, using VSExtComp.
diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py
index 8f485a2..7b4c2ef 100644
--- a/PCbuild/build_ssl.py
+++ b/PCbuild/build_ssl.py
@@ -84,9 +84,59 @@
         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 @@
     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.