[pywin32-checkins] pywin32 setup.py,1.14,1.15
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-07-31 09:02:09
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21674 Modified Files: setup.py Log Message: win32help with new platform SDK requires bufferoverflowu.lib - this also involved moving find_platform_sdk(). Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** setup.py 29 Jul 2005 01:36:25 -0000 1.14 --- setup.py 31 Jul 2005 09:01:59 -0000 1.15 *************** *** 88,91 **** --- 88,161 ---- os.chdir(os.path.dirname(this_file)) + # We need to know the platform SDK dir before we can list the extensions. + def find_platform_sdk_dir(): + # Finding the Platform SDK install dir is a treat. There can be some + # dead ends so we only consider the job done if we find the "windows.h" + # landmark. + DEBUG = False + landmark = "include\\windows.h" + # 1. The use might have their current environment setup for the + # SDK, in which case the "MSSdk" env var is set. + sdkdir = os.environ.get("MSSdk") + if sdkdir: + if DEBUG: + print "PSDK: try %MSSdk%: '%s'" % sdkdir + if os.path.isfile(os.path.join(sdkdir, landmark)): + return sdkdir + # 2. The "Install Dir" value in the + # HKLM\Software\Microsoft\MicrosoftSDK\Directories registry key + # sometimes points to the right thing. However, after upgrading to + # the "Platform SDK for Windows Server 2003 SP1" this is dead end. + try: + key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, + r"Software\Microsoft\MicrosoftSDK\Directories") + sdkdir, ignore = _winreg.QueryValueEx(key, "Install Dir") + except EnvironmentError: + pass + else: + if DEBUG: + print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ + "\Directories\Install Dir': '%s'" % sdkdir + if os.path.isfile(os.path.join(sdkdir, landmark)): + return sdkdir + # 3. Each installed SDK (not just the platform SDK) seems to have GUID + # subkey of HKLM\Software\Microsoft\MicrosoftSDK\InstalledSDKs and + # it *looks* like the latest installed Platform SDK will be the + # only one with an "Install Dir" sub-value. + try: + key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, + r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") + i = 0 + while True: + guid = _winreg.EnumKey(key, i) + guidkey = _winreg.OpenKey(key, guid) + try: + sdkdir, ignore = _winreg.QueryValueEx(guidkey, "Install Dir") + except EnvironmentError: + pass + else: + if DEBUG: + print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ + "\InstallSDKs\%s\Install Dir': '%s'"\ + % (guid, sdkdir) + if os.path.isfile(os.path.join(sdkdir, landmark)): + return sdkdir + i += 1 + except EnvironmentError: + pass + # 4. Failing this just try a few well-known default install locations. + progfiles = os.environ.get("ProgramFiles", r"C:\Program Files") + defaultlocs = [ + os.path.join(progfiles, "Microsoft Platform SDK"), + os.path.join(progfiles, "Microsoft SDK"), + ] + for sdkdir in defaultlocs: + if DEBUG: + print "PSDK: try default location: '%s'" % sdkdir + if os.path.isfile(os.path.join(sdkdir, landmark)): + return sdkdir + + sdk_dir = find_platform_sdk_dir() + class WinExt (Extension): # Base class for all win32 extensions, with some predefined *************** *** 294,298 **** # (Note that just having them in INCLUDE/LIB does *not* work - # distutils thinks it knows better, and resets those vars. ! sdk_dir = find_platform_sdk_dir() if sdk_dir: extra = os.path.join(sdk_dir, 'include') --- 364,368 ---- # (Note that just having them in INCLUDE/LIB does *not* work - # distutils thinks it knows better, and resets those vars. ! # Note: sdk_dir is a global. if sdk_dir: extra = os.path.join(sdk_dir, 'include') *************** *** 831,835 **** ("win32evtlog", "advapi32 oleaut32", False), # win32gui handled below - ("win32help", "htmlhelp user32 advapi32", False, 0x0500), ("win32lz", "lz32", False), ("win32net", "netapi32", True, None, """ --- 901,904 ---- *************** *** 908,911 **** --- 977,992 ---- ] + # win32help uses htmlhelp.lib which is built with MSVC7 and /GS. This + # causes problems with references to the @__security_check_cookie magic. + # Use bufferoverflowu.lib if it exists. + win32help_libs = "htmlhelp user32 advapi32" + if sdk_dir and os.path.exists(os.path.join(sdk_dir, "Lib", "bufferoverflowu.lib")): + win32help_libs += " bufferoverflowu" + win32_extensions += [ + WinExt_win32('win32help', + libraries=win32help_libs, + windows_h_version = 0x500), + ] + dirs = { 'adsi' : 'com/win32comext/adsi/src', *************** *** 1043,1115 **** swig_include_files = "mapilib adsilib".split() - - def find_platform_sdk_dir(): - # Finding the Platform SDK install dir is a treat. There can be some - # dead ends so we only consider the job done if we find the "windows.h" - # landmark. - DEBUG = False - landmark = "include\\windows.h" - # 1. The use might have their current environment setup for the - # SDK, in which case the "MSSdk" env var is set. - sdkdir = os.environ.get("MSSdk") - if sdkdir: - if DEBUG: - print "PSDK: try %MSSdk%: '%s'" % sdkdir - if os.path.isfile(os.path.join(sdkdir, landmark)): - return sdkdir - # 2. The "Install Dir" value in the - # HKLM\Software\Microsoft\MicrosoftSDK\Directories registry key - # sometimes points to the right thing. However, after upgrading to - # the "Platform SDK for Windows Server 2003 SP1" this is dead end. - try: - key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, - r"Software\Microsoft\MicrosoftSDK\Directories") - sdkdir, ignore = _winreg.QueryValueEx(key, "Install Dir") - except EnvironmentError: - pass - else: - if DEBUG: - print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ - "\Directories\Install Dir': '%s'" % sdkdir - if os.path.isfile(os.path.join(sdkdir, landmark)): - return sdkdir - # 3. Each installed SDK (not just the platform SDK) seems to have GUID - # subkey of HKLM\Software\Microsoft\MicrosoftSDK\InstalledSDKs and - # it *looks* like the latest installed Platform SDK will be the - # only one with an "Install Dir" sub-value. - try: - key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, - r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") - i = 0 - while True: - guid = _winreg.EnumKey(key, i) - guidkey = _winreg.OpenKey(key, guid) - try: - sdkdir, ignore = _winreg.QueryValueEx(guidkey, "Install Dir") - except EnvironmentError: - pass - else: - if DEBUG: - print r"PSDK: try 'HKLM\Software\Microsoft\MicrosoftSDK"\ - "\InstallSDKs\%s\Install Dir': '%s'"\ - % (guid, sdkdir) - if os.path.isfile(os.path.join(sdkdir, landmark)): - return sdkdir - i += 1 - except EnvironmentError: - pass - # 4. Failing this just try a few well-known default install locations. - progfiles = os.environ.get("ProgramFiles", r"C:\Program Files") - defaultlocs = [ - os.path.join(progfiles, "Microsoft Platform SDK"), - os.path.join(progfiles, "Microsoft SDK"), - ] - for sdkdir in defaultlocs: - if DEBUG: - print "PSDK: try default location: '%s'" % sdkdir - if os.path.isfile(os.path.join(sdkdir, landmark)): - return sdkdir - - # Helper to allow our script specifications to include wildcards. def expand_modules(module_dir): --- 1124,1127 ---- |