[pywin32-checkins] pywin32 setup.py,1.87,1.88
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-05 11:01:57
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29982 Modified Files: setup.py Log Message: various build improvements from py3k branch, including: * separate SWIG executables for py2k andpy3k * new names for SWIG generated files due to the above * various py3k-friendly build improvements Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** setup.py 17 Dec 2008 13:04:59 -0000 1.87 --- setup.py 5 Jan 2009 11:01:45 -0000 1.88 *************** *** 1,3 **** ! build_id="212.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212.6" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 71,82 **** import types, glob import re - import _winreg ! # Python version compatibility hacks ! try: ! True; False ! except NameError: ! True=0==0 ! False=1==0 # The rest of our imports. --- 71,82 ---- import types, glob import re ! is_py3k = sys.version_info > (3,) # get this out of the way early on... ! # We have special handling for _winreg so our setup3.py script can avoid ! # using the 'imports' fixer and therefore start much faster... ! if is_py3k: ! import winreg as _winreg ! else: ! import _winreg # The rest of our imports. *************** *** 251,254 **** --- 251,256 ---- depends=None, platforms=None, # none means 'all platforms' + unicode_mode=None, # 'none'==default or specifically true/false. + implib_name=None, ): assert dsp_file or sources, "Either dsp_file or sources must be specified" *************** *** 277,280 **** --- 279,283 ---- self.base_address = base_address self.platforms = platforms + self.implib_name = implib_name Extension.__init__ (self, name, sources, include_dirs, *************** *** 289,292 **** --- 292,296 ---- export_symbols) self.depends = depends or [] # stash it here, as py22 doesn't have it. + self.unicode_mode = unicode_mode def parse_def_file(self, path): *************** *** 294,303 **** result = [] for line in open(path).readlines(): ! line = string.rstrip(line) if line and line[0] in string.whitespace: ! tokens = string.split(line) ! if not tokens[0][0] in string.letters: continue ! result.append(string.join(tokens, ',')) return result --- 298,307 ---- result = [] for line in open(path).readlines(): ! line = line.rstrip() if line and line[0] in string.whitespace: ! tokens = line.split() ! if not tokens[0][0] in string.ascii_letters: continue ! result.append(','.join(tokens)) return result *************** *** 307,321 **** return result dsp_path = os.path.dirname(dsp) for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": ! if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c', '.i', '.rc', '.mc']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) # Sort the sources so that (for example) the .mc file is processed first, # building this may create files included by other source files. - # Note that this requires a patch to distutils' ccompiler classes so that - # they build the sources in the order given. build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(os.path.splitext(fname)[-1].lower()), fname) --- 311,336 ---- return result dsp_path = os.path.dirname(dsp) + seen_swigs = [] for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": ! ext = os.path.splitext(fields[1])[1].lower() ! if ext in ['.cpp', '.c', '.i', '.rc', '.mc']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) + if ext == '.i': + seen_swigs.append(pathname) + # ack - .dsp files may have references to the generated 'foomodule.cpp' + # from 'foo.i' - but we now do things differently... + for ss in seen_swigs: + base, ext = os.path.splitext(ss) + nuke = base + "module.cpp" + try: + result.remove(nuke) + except ValueError: + pass # Sort the sources so that (for example) the .mc file is processed first, # building this may create files included by other source files. build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(os.path.splitext(fname)[-1].lower()), fname) *************** *** 372,375 **** --- 387,394 ---- self.extra_compile_args.append("/EHsc") + # If someone needs a specially named implib created, handle that + if self.implib_name: + implib = os.path.join(build_ext.build_temp, self.implib_name) + self.extra_link_args.append("/IMPLIB:%s" % implib) # Try and find the MFC source code, so we can reach inside for # some of the ActiveX support we need. We need to do this late, so *************** *** 388,398 **** if found_mfc: break class WinExt_pythonwin(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "pythonwin/" + name + ".dsp" kw.setdefault("extra_compile_args", []).extend( ['-D_AFXDLL', '-D_AFXEXT','-D_MBCS']) WinExt.__init__(self, name, **kw) def get_pywin32_dir(self): --- 407,432 ---- if found_mfc: break + # Handle Unicode - if unicode_mode is None, then it means True + # for py3k, false for py2 + unicode_mode = self.unicode_mode + if unicode_mode is None: + unicode_mode = is_py3k + if unicode_mode: + self.extra_compile_args.append("/DUNICODE") + self.extra_compile_args.append("/D_UNICODE") + self.extra_compile_args.append("/DWINNT") + # Unicode, Windows executables seem to need this magic: + if "/SUBSYSTEM:WINDOWS" in self.extra_link_args: + self.extra_link_args.append("/ENTRY:wWinMainCRTStartup") class WinExt_pythonwin(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "pythonwin/" + name + ".dsp" + if 'unicode_mode' not in kw: + kw['unicode_mode']=None kw.setdefault("extra_compile_args", []).extend( ['-D_AFXDLL', '-D_AFXEXT','-D_MBCS']) + WinExt.__init__(self, name, **kw) def get_pywin32_dir(self): *************** *** 401,405 **** class WinExt_win32(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "win32/" + name + ".dsp" WinExt.__init__(self, name, **kw) --- 435,439 ---- class WinExt_win32(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "win32/" + name + ".dsp" WinExt.__init__(self, name, **kw) *************** *** 415,419 **** class WinExt_win32com(WinExt): def __init__ (self, name, **kw): ! if not kw.has_key("dsp_file") and not kw.get("sources"): kw["dsp_file"] = "com/" + name + ".dsp" kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32" --- 449,453 ---- class WinExt_win32com(WinExt): def __init__ (self, name, **kw): ! if "dsp_file" not in kw and not kw.get("sources"): kw["dsp_file"] = "com/" + name + ".dsp" kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32" *************** *** 633,638 **** break else: ! raise RuntimeError, "Can't find a version in Windows.h" ! if ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ "version 0x%x is installed." \ --- 667,673 ---- break else: ! raise RuntimeError("Can't find a version in Windows.h") ! if ext.windows_h_version is not None and \ ! ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ "version 0x%x is installed." \ *************** *** 652,656 **** patched_libs = [] for lib in ext.libraries: ! if self.found_libraries.has_key(lib.lower()): found = self.found_libraries[lib.lower()] else: --- 687,691 ---- patched_libs = [] for lib in ext.libraries: ! if lib.lower() in self.found_libraries: found = self.found_libraries[lib.lower()] else: *************** *** 743,747 **** self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError, "Not a win32 package!" self.build_extension(ext) --- 778,782 ---- self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError("Not a win32 package!") self.build_extension(ext) *************** *** 758,762 **** self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError, "Not a win32 package!" self.build_exefile(ext) --- 793,797 ---- self.package = ext.get_pywin32_dir() except AttributeError: ! raise RuntimeError("Not a win32 package!") self.build_exefile(ext) *************** *** 789,793 **** src = os.path.join(os.environ.get('SystemRoot'), 'System32', 'mfc71.dll') if not os.path.isfile(src): ! raise RuntimeError, "Can't find %r" % (src,) self.copy_file(src, target_dir) else: --- 824,828 ---- src = os.path.join(os.environ.get('SystemRoot'), 'System32', 'mfc71.dll') if not os.path.isfile(src): ! raise RuntimeError("Can't find %r" % (src,)) self.copy_file(src, target_dir) else: *************** *** 808,812 **** mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): ! raise RuntimeError, "Can't find the redist dir at %r" % (mfc_dir) files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() for f in files: --- 843,847 ---- mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): ! raise RuntimeError("Can't find the redist dir at %r" % (mfc_dir)) files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() for f in files: *************** *** 818,828 **** def build_exefile(self, ext): - from types import ListType, TupleType sources = ext.sources ! if sources is None or type(sources) not in (ListType, TupleType): ! raise DistutilsSetupError, \ ("in 'ext_modules' option (extension '%s'), " + "'sources' must be present and must be " + ! "a list of source filenames") % ext.name sources = list(sources) --- 853,862 ---- def build_exefile(self, ext): sources = ext.sources ! if sources is None or type(sources) not in (list, tuple): ! raise DistutilsSetupError( ("in 'ext_modules' option (extension '%s'), " + "'sources' must be present and must be " + ! "a list of source filenames") % ext.name) sources = list(sources) *************** *** 958,961 **** --- 992,997 ---- build_ext.build_extension(self, ext) # XXX This has to be changed for mingw32 + # Get the .lib files we need. This is limited to pywintypes, + # pythoncom and win32ui - but the first 2 have special names extra = self.debug and "_d.lib" or ".lib" if ext.name in ("pywintypes", "pythoncom"): *************** *** 964,986 **** name1 = "%s%d%d%s" % (ext.name, sys.version_info[0], sys.version_info[1], extra) name2 = "%s%s" % (ext.name, extra) ! else: name1 = name2 = ext.name + extra - # The compiler always creates 'pywintypes22.lib', whereas we - # actually want 'pywintypes.lib' - copy it over. - # Worse: 2.3+ MSVCCompiler constructs the .lib file in the same - # directory as the first source file's object file: - # os.path.dirname(objects[0]) - # rather than in the self.build_temp directory - if sys.version_info > (2,3): - # 2.3+ - Wrong dir, numbered name - src = os.path.join(old_build_temp, - os.path.dirname(ext.sources[0]), - name1) else: ! # 2.2 it is in the right dir, just with the 'numbered' named. ! src = os.path.join(self.build_temp, name1) ! dst = os.path.join(old_build_temp, name2) ! if os.path.abspath(src) != os.path.abspath(dst): ! self.copy_file(src, dst)#, update=1) finally: self.build_temp = old_build_temp --- 1000,1025 ---- name1 = "%s%d%d%s" % (ext.name, sys.version_info[0], sys.version_info[1], extra) name2 = "%s%s" % (ext.name, extra) ! elif ext.name in ("win32ui",): name1 = name2 = ext.name + extra else: ! name1 = name2 = None ! if name1 is not None: ! # The compiler always creates 'pywintypes22.lib', whereas we ! # actually want 'pywintypes.lib' - copy it over. ! # Worse: 2.3+ MSVCCompiler constructs the .lib file in the same ! # directory as the first source file's object file: ! # os.path.dirname(objects[0]) ! # rather than in the self.build_temp directory ! if sys.version_info > (2,3): ! # 2.3+ - Wrong dir, numbered name ! src = os.path.join(old_build_temp, ! os.path.dirname(ext.sources[0]), ! name1) ! else: ! # 2.2 it is in the right dir, just with the 'numbered' named. ! src = os.path.join(self.build_temp, name1) ! dst = os.path.join(old_build_temp, name2) ! if os.path.abspath(src) != os.path.abspath(dst): ! self.copy_file(src, dst)#, update=1) finally: self.build_temp = old_build_temp *************** *** 996,1001 **** elif name.endswith("win32.perfmondata"): return r"win32\perfmondata" + extra_dll - elif name.endswith("win32.win32popenWin9x"): - return r"win32\win32popenWin9x" + extra_exe elif name.endswith("win32.pythonservice"): return r"win32\pythonservice" + extra_exe --- 1035,1038 ---- *************** *** 1011,1020 **** return build_ext.get_export_symbols(self, ext) ! def find_swig (self): ! # We know where swig is ! os.environ["SWIG_LIB"] = os.path.abspath(r"swig\swig_lib") ! return os.path.abspath(r"swig\swig.exe") ! def swig_sources (self, sources, ext=None): new_sources = [] swig_sources = [] --- 1048,1069 ---- return build_ext.get_export_symbols(self, ext) ! def find_swig(self): ! if is_py3k and "SWIG_PY3" in os.environ: ! swig = os.environ["SWIG_PY3"] ! elif not is_py3k and "SWIG_PY2" in os.environ: ! swig = os.environ["SWIG_PY2"] ! elif "SWIG" in os.environ: ! swig = os.environ["SWIG"] ! else: ! # We know where our swig is ! if is_py3k: ! swig = os.path.abspath(r"swig\swig_py3k.exe") ! else: ! swig = os.path.abspath(r"swig\swig.exe") ! lib = os.path.join(os.path.dirname(swig), "swig_lib") ! os.environ["SWIG_LIB"] = lib ! return swig ! def swig_sources(self, sources, ext=None): new_sources = [] swig_sources = [] *************** *** 1024,1031 **** # source -- but there should be an option to put SWIG output in # the temp dir. ! # XXX - Note that swig_wince_modules no longer #include the real ! # generated .cpp file (well, they do, but are avoided via the ! # pre-processor.) So this is no longer a reason we can't generate ! # directly to the temp directory. target_ext = '.cpp' for source in sources: --- 1073,1078 ---- # source -- but there should be an option to put SWIG output in # the temp dir. ! # Adding py3k to the mix means we *really* need to move to generating ! # to the temp dir... target_ext = '.cpp' for source in sources: *************** *** 1035,1040 **** continue swig_sources.append(source) ! # Patch up the filenames for SWIG modules that also build ! # under WinCE - see defn of swig_wince_modules for details if os.path.basename(base) in swig_interface_parents: swig_targets[source] = base + target_ext --- 1082,1086 ---- continue swig_sources.append(source) ! # Patch up the filenames for various special cases... if os.path.basename(base) in swig_interface_parents: swig_targets[source] = base + target_ext *************** *** 1043,1058 **** # More vile hacks. winxpmodule is built from win32gui.i - # just different #defines are setup for windows.h. new_target = os.path.join(os.path.dirname(base), ! "winxpguimodule") + target_ext ! swig_targets[source] = new_target ! new_sources.append(new_target) ! elif os.path.basename(base) in swig_wince_modules: ! # We need to add this .cpp to the sources, so it ! # will be built. ! new_target = base + 'module_win32' + target_ext swig_targets[source] = new_target new_sources.append(new_target) else: ! swig_targets[source] = base + 'module' + target_ext else: new_sources.append(source) --- 1089,1102 ---- # More vile hacks. winxpmodule is built from win32gui.i - # just different #defines are setup for windows.h. + pyver = sys.version_info[0] # 2 or 3! new_target = os.path.join(os.path.dirname(base), ! "winxpgui_py%d_swig%s" % (pyver, target_ext)) swig_targets[source] = new_target new_sources.append(new_target) else: ! pyver = sys.version_info[0] # 2 or 3! ! new_target = '%s_py%d_swig%s' % (base, pyver, target_ext) ! new_sources.append(new_target) ! swig_targets[source] = new_target else: new_sources.append(source) *************** *** 1067,1070 **** --- 1111,1118 ---- swig_cmd.append("-dnone",) # we never use the .doc files. swig_cmd.extend(self.current_extension.extra_swig_commands) + if is_py3k: + swig_cmd.append("-DSWIG_PY3K") + else: + swig_cmd.append("-DSWIG_PY2K") target = swig_targets[source] try: *************** *** 1088,1095 **** # build for any platform sees these as dirty. # This could probably go once we generate .cpp into the temp dir. ! if self.force or newer(os.path.abspath(source), os.path.abspath(target)): ! swig_cmd.extend(["-o", ! os.path.abspath(target), ! os.path.abspath(source)]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) --- 1136,1145 ---- # build for any platform sees these as dirty. # This could probably go once we generate .cpp into the temp dir. ! fqsource = os.path.abspath(source) ! fqtarget = os.path.abspath(target) ! rebuild = self.force or newer(fqsource, fqtarget) ! log.debug("should swig %s->%s=%s", source, target, rebuild) ! if rebuild: ! swig_cmd.extend(["-o", fqtarget, fqsource]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) *************** *** 1120,1129 **** # for bdist_wininst to use) - in which case we must *not* run our # installer ! if not self.dry_run and not self.skip_build and not self.root: ! # What executable to use? This one I guess. ! filename = os.path.join(os.path.dirname(this_file), "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError, "Can't find '%s'" % (filename,) print "Executing post install script..." os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, filename, --- 1170,1181 ---- # for bdist_wininst to use) - in which case we must *not* run our # installer ! if not self.dry_run and not self.root: ! # We must run the script we just installed into Scripts, as it ! # may have had 2to3 run over it. ! filename = os.path.join(sys.prefix, "Scripts", "pywin32_postinstall.py") if not os.path.isfile(filename): ! raise RuntimeError("Can't find '%s'" % (filename,)) print "Executing post install script..." + # What executable to use? This one I guess. os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, filename, *************** *** 1136,1140 **** # (otherwise we replace all of build_extension!) def my_new_compiler(**kw): ! if kw.has_key('compiler') and kw['compiler'] in (None, 'msvc'): return my_compiler() return orig_new_compiler(**kw) --- 1188,1192 ---- # (otherwise we replace all of build_extension!) def my_new_compiler(**kw): ! if 'compiler' in kw and kw['compiler'] in (None, 'msvc'): return my_compiler() return orig_new_compiler(**kw) *************** *** 1279,1283 **** WinExt_win32("perfmondata", libraries="advapi32", ! extra_compile_args=["-DUNICODE", "-D_UNICODE", "-DWINNT"], export_symbol_file = "win32/src/PerfMon/perfmondata.def", is_regular_dll = 1, --- 1331,1335 ---- WinExt_win32("perfmondata", libraries="advapi32", ! unicode_mode=True, export_symbol_file = "win32/src/PerfMon/perfmondata.def", is_regular_dll = 1, *************** *** 1286,1304 **** for info in ( ! ("mmapfile", "", False), ! ("odbc", "odbc32 odbccp32", False), ("perfmon", "", True), ! ("timer", "user32", False), ! ("win2kras", "rasapi32", False, 0x0500), ! ("win32api", "user32 advapi32 shell32 version", False, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", False, 0x0500, 'win32/src/win32crypt.i win32/src/win32cryptmodule.cpp'), ! ("win32file", "oleaut32", False, 0x0500), ! ("win32event", "user32", False), ! ("win32clipboard", "gdi32 user32 shell32", False), ! ("win32evtlog", "advapi32 oleaut32", False), # win32gui handled below ! ("win32job", "user32", True, 0x0500, 'win32/src/win32job.i win32/src/win32jobmodule.cpp'), ! ("win32lz", "lz32", False), ("win32net", "netapi32 advapi32", True, None, """ win32/src/win32net/win32netfile.cpp win32/src/win32net/win32netgroup.cpp --- 1338,1356 ---- for info in ( ! ("mmapfile", "", None), ! ("odbc", "odbc32 odbccp32", None), ("perfmon", "", True), ! ("timer", "user32", None), ! ("win2kras", "rasapi32", None, 0x0500), ! ("win32api", "user32 advapi32 shell32 version", None, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i'), ! ("win32file", "oleaut32", None, 0x0500), ! ("win32event", "user32", None), ! ("win32clipboard", "gdi32 user32 shell32", None), ! ("win32evtlog", "advapi32 oleaut32", None), # win32gui handled below ! ("win32job", "user32", True, 0x0500, 'win32/src/win32job.i'), ! ("win32lz", "lz32", None), ("win32net", "netapi32 advapi32", True, None, """ win32/src/win32net/win32netfile.cpp win32/src/win32net/win32netgroup.cpp *************** *** 1307,1335 **** win32/src/win32net/win32netuser.cpp """), ! ("win32pdh", "", False), ! ("win32pipe", "", False), ! ("win32print", "winspool user32 gdi32", False, 0x0500), ! ("win32process", "advapi32 user32", False, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ ! win32/src/win32security.i win32/src/win32securitymodule.cpp win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), ("win32service", "advapi32 oleaut32 user32", True, 0x0501), ! ("win32trace", "advapi32", False), ! ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False, 0x500, """ ! win32/src/win32inet.i win32/src/win32inetmodule.cpp win32/src/win32inet_winhttp.cpp""" ), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("win32ts", "WtsApi32", True, 0x0501, "win32/src/win32tsmodule.cpp"), ! ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), ("win32transaction", "kernel32", True, 0x0501, "win32/src/win32transactionmodule.cpp"), ): ! name, lib_names, is_unicode = info[:3] windows_h_ver = sources = None if len(info)>3: --- 1359,1389 ---- win32/src/win32net/win32netuser.cpp """), ! ("win32pdh", "", None), ! ("win32pipe", "", None, None, 'win32/src/win32pipe.i win32/src/win32popen.cpp'), ! ("win32print", "winspool user32 gdi32", None, 0x0500), ! ("win32process", "advapi32 user32", None, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", None), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ ! win32/src/win32security.i win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), ("win32service", "advapi32 oleaut32 user32", True, 0x0501), ! ("win32trace", "advapi32", None), ! ("win32wnet", "netapi32 mpr", None), ! ("win32inet", "wininet", None, 0x500, """ ! win32/src/win32inet.i win32/src/win32inet_winhttp.cpp""" ), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("win32ts", "WtsApi32", True, 0x0501, "win32/src/win32tsmodule.cpp"), ! ("_win32sysloader", "", None, 0x0501, "win32/src/_win32sysloader.cpp"), ("win32transaction", "kernel32", True, 0x0501, "win32/src/win32transactionmodule.cpp"), ): ! name, lib_names, unicode_mode = info[:3] ! # unicode_mode == None means "not on py2.6, yes on py3", True means everywhere ! # False means nowhere. windows_h_ver = sources = None if len(info)>3: *************** *** 1338,1348 **** sources = info[4].split() extra_compile_args = [] - if is_unicode: - extra_compile_args = ['-DUNICODE', '-D_UNICODE', '-DWINNT'] ext = WinExt_win32(name, libraries=lib_names, extra_compile_args = extra_compile_args, windows_h_version = windows_h_ver, ! sources = sources) win32_extensions.append(ext) --- 1392,1401 ---- sources = info[4].split() extra_compile_args = [] ext = WinExt_win32(name, libraries=lib_names, extra_compile_args = extra_compile_args, windows_h_version = windows_h_ver, ! sources = sources, ! unicode_mode = unicode_mode) win32_extensions.append(ext) *************** *** 1372,1388 **** # winxptheme WinExt_win32("_winxptheme", ! sources = ["win32/src/_winxptheme.i", "win32/src/_winxpthememodule.cpp"], libraries="gdi32 user32 comdlg32 comctl32 shell32 Uxtheme", windows_h_version=0x0500, - extra_compile_args = ['-DUNICODE', '-D_UNICODE', '-DWINNT'], ), ] win32_extensions += [ WinExt_win32('servicemanager', ! extra_compile_args = ['-DUNICODE', '-D_UNICODE', ! '-DWINNT', '-DPYSERVICE_BUILD_DLL'], libraries = "user32 ole32 advapi32 shell32", dsp_file = r"win32\Pythonservice servicemanager.dsp", ! windows_h_version = 0x500), ] --- 1425,1440 ---- # winxptheme WinExt_win32("_winxptheme", ! sources = ["win32/src/_winxptheme.i"], libraries="gdi32 user32 comdlg32 comctl32 shell32 Uxtheme", windows_h_version=0x0500, ), ] win32_extensions += [ WinExt_win32('servicemanager', ! extra_compile_args = ['-DPYSERVICE_BUILD_DLL'], libraries = "user32 ole32 advapi32 shell32", dsp_file = r"win32\Pythonservice servicemanager.dsp", ! windows_h_version = 0x500, ! unicode_mode=True,), ] *************** *** 1487,1491 **** %(mapi)s/PyIProfSect.i %(mapi)s/PyIProfSect.cpp %(mapi)s/PyIMAPIAdviseSink.cpp - %(mapi)s/mapiutil.cpp %(mapi)s/mapiguids.cpp --- 1539,1542 ---- *************** *** 1554,1558 **** sources=(""" %(propsys)s/propsys.cpp ! """ % dirs).split()), --- 1605,1611 ---- sources=(""" %(propsys)s/propsys.cpp ! """ % dirs).split(), ! implib_name="pypropsys.lib", ! ), *************** *** 1599,1603 **** WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), ! WinExt_pythonwin("dde", pch_header="stdafxdde.h", platforms=['win32']), ] # win32ui is large, so we reserve more bytes than normal --- 1652,1658 ---- WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), ! WinExt_pythonwin("dde", pch_header="stdafxdde.h", ! depends=["win32/src/stddde.h", "pythonwin/ddemodule.h"], ! platforms=['win32']), ] # win32ui is large, so we reserve more bytes than normal *************** *** 1635,1644 **** W32_exe_files = [ - WinExt_win32("win32popenWin9x", - libraries = "user32", - platforms = ["win32"]), WinExt_win32("pythonservice", dsp_file = "win32/PythonService EXE.dsp", ! extra_compile_args = ['-DUNICODE', '-D_UNICODE', '-DWINNT'], extra_link_args=["/SUBSYSTEM:CONSOLE"], libraries = "user32 advapi32 ole32 shell32"), --- 1690,1696 ---- W32_exe_files = [ WinExt_win32("pythonservice", dsp_file = "win32/PythonService EXE.dsp", ! unicode_mode = True, extra_link_args=["/SUBSYSTEM:CONSOLE"], libraries = "user32 advapi32 ole32 shell32"), *************** *** 1681,1688 **** } - # A list of modules that can also be built for Windows CE. These generate - # their .i to _win32.cpp or _wince.cpp. - swig_wince_modules = "win32event win32file win32gui win32process".split() - # .i files that are #included, and hence are not part of the build. Our .dsp # parser isn't smart enough to differentiate these. --- 1733,1736 ---- *************** *** 1718,1726 **** flist.exclude_pattern(re.compile(".*\\\\\."), is_regex=1) if not flist.files: ! raise RuntimeError, "No files match '%s'" % file files_use = flist.files else: if not os.path.isfile(file): ! raise RuntimeError, "No file '%s'" % file files_use = (file,) for fname in files_use: --- 1766,1774 ---- flist.exclude_pattern(re.compile(".*\\\\\."), is_regex=1) if not flist.files: ! raise RuntimeError("No files match '%s'" % file) files_use = flist.files else: if not os.path.isfile(file): ! raise RuntimeError("No file '%s'" % file) files_use = (file,) for fname in files_use: *************** *** 1737,1741 **** temp = convert_data_files([file]) except RuntimeError, details: ! if not str(details).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) --- 1785,1789 ---- temp = convert_data_files([file]) except RuntimeError, details: ! if not str(details.args[0]).startswith("No file"): raise log.info('NOTE: Optional file %s not found - skipping' % file) *************** *** 1816,1819 **** --- 1864,1868 ---- dll_base_address += 0x30000 + cmdclass = { 'install': my_install, 'build': my_build, *************** *** 1821,1825 **** 'install_data': my_install_data, } ! dist = setup(name="pywin32", version=str(build_id), --- 1870,1874 ---- 'install_data': my_install_data, } ! dist = setup(name="pywin32", version=str(build_id), *************** *** 1913,1922 **** # If we did any extension building, and report if we skipped any. ! if dist.command_obj.has_key('build_ext'): what_string = "built" ! if dist.command_obj.has_key('install'): # just to be purdy what_string += "/installed" # Print the list of extension modules we skipped building. ! if dist.command_obj.has_key('build_ext'): excluded_extensions = dist.command_obj['build_ext'].excluded_extensions if excluded_extensions: --- 1962,1971 ---- # If we did any extension building, and report if we skipped any. ! if 'build_ext' in dist.command_obj: what_string = "built" ! if 'install' in dist.command_obj: # just to be purdy what_string += "/installed" # Print the list of extension modules we skipped building. ! if 'build_ext' in dist.command_obj: excluded_extensions = dist.command_obj['build_ext'].excluded_extensions if excluded_extensions: |