Update of /cvsroot/pywin32/pywin32
In directory vz-cvs-2.sog:/tmp/cvs-serv15501
Modified Files:
CHANGES.txt MANIFEST.in setup.py
Log Message:
add a 'loader module' with a manifest and other magic for COM objects
Index: setup.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/setup.py,v
retrieving revision 1.119
retrieving revision 1.120
diff -C2 -d -r1.119 -r1.120
*** setup.py 21 Feb 2011 00:31:42 -0000 1.119
--- setup.py 26 Feb 2011 00:24:53 -0000 1.120
***************
*** 902,905 ****
--- 902,946 ----
os.path.join(self.build_lib, "pythonwin"))
+ def _build_pycom_loader(self):
+ # the base compiler strips out the manifest from modules it builds
+ # which can't be done for this module - having the manifest is the
+ # reason it needs to exist!
+ # At least this is made easier by it not depending on Python itself,
+ # so the compile and link are simple...
+ suffix = "%d%d" % (sys.version_info[0], sys.version_info[1])
+ if self.debug:
+ suffix += '_d'
+ src = r"com\win32com\src\PythonCOMLoader.cpp"
+ build_temp = os.path.abspath(self.build_temp)
+ obj = os.path.join(build_temp, os.path.splitext(src)[0]+".obj")
+ dll = os.path.join(self.build_lib, "pywin32_system32", "pythoncomloader"+suffix+".dll")
+ if self.force or newer_group([src], obj, 'newer'):
+ ccargs = [self.compiler.cc, '/c']
+ if self.debug:
+ ccargs.extend(self.compiler.compile_options_debug)
+ else:
+ ccargs.extend(self.compiler.compile_options)
+ ccargs.append('/Fo' + obj)
+ ccargs.append(src)
+ ccargs.append('/DDLL_DELEGATE=\\"pythoncom%s.dll\\"' % (suffix,))
+ self.spawn(ccargs)
+
+ deffile = r"com\win32com\src\PythonCOMLoader.def"
+ if self.force or newer_group([obj, deffile], dll, 'newer'):
+ largs = [self.compiler.linker, '/DLL', '/nologo', '/incremental:no']
+ if self.debug:
+ largs.append("/DEBUG")
+ temp_manifest = os.path.join(build_temp, os.path.basename(dll) + ".manifest")
+ largs.append('/MANIFESTFILE:' + temp_manifest)
+ largs.append('/PDB:None')
+ largs.append("/OUT:" + dll)
+ largs.append("/DEF:" + deffile)
+ largs.append("/IMPLIB:" + os.path.join(build_temp, "PythonCOMLoader"+suffix+".lib"))
+ largs.append(obj)
+ self.spawn(largs)
+ # and the manifest
+ out_arg = '-outputresource:%s;2' % (dll,)
+ self.spawn(['mt.exe', '-nologo', '-manifest', temp_manifest, out_arg])
+
def build_extensions(self):
# First, sanity-check the 'extensions' list
***************
*** 946,949 ****
--- 987,993 ----
# Not sure how to make this completely generic, and there is no
# need at this stage.
+ if sys.version_info > (2,6):
+ # only stuff built with msvc9 needs this loader.
+ self._build_pycom_loader()
self._build_scintilla()
# Copy cpp lib files needed to create Python COM extensions
Index: MANIFEST.in
===================================================================
RCS file: /cvsroot/pywin32/pywin32/MANIFEST.in,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** MANIFEST.in 13 Feb 2011 02:11:31 -0000 1.20
--- MANIFEST.in 26 Feb 2011 00:24:53 -0000 1.21
***************
*** 34,37 ****
--- 34,38 ----
include com/win32com/src/*.h
include com/win32com/src/PythonCOM.def
+ include com/win32com/src/PythonCOMLoader.def
include com/win32com/readme.htm
include com/win32com/HTML/*.html
Index: CHANGES.txt
===================================================================
RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** CHANGES.txt 26 Feb 2011 00:05:35 -0000 1.69
--- CHANGES.txt 26 Feb 2011 00:24:53 -0000 1.70
***************
*** 8,11 ****
--- 8,18 ----
Since build 215:
----------------
+ * New loader module for COM objects to avoid some CRT manifest issues.
+ pythoncomloaderxx.dll will be copied to your System32 directory and used as
+ the entry-point for COM objects instead of pythoncomxx.dll. This DLL
+ is very small - includes a manifest referencing the C runtime library and
+ simply loads pythoncomxx.dll and deletes the COM object creation back to it.
+ You will need to re-register any COM objects you have to take advantage of
+ this.
* Fix printing on pythonwin on 3.x
|