From fa6c41f363493c6341bf0fbbf883060264cfdcec Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 21 Mar 2009 14:49:10 +0000 Subject: [PATCH] Changes for windows --- doc/makepanda/makechm.py | 9 +++++---- doc/makepanda/makepanda.py | 2 +- doc/makepanda/makepandacore.py | 23 +++++++++++++++++++++-- dtool/src/dtoolbase/dtoolbase.h | 12 ++++++++++++ 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/doc/makepanda/makechm.py b/doc/makepanda/makechm.py index 89a2e4eb9c..e517128ed6 100755 --- a/doc/makepanda/makechm.py +++ b/doc/makepanda/makechm.py @@ -261,17 +261,18 @@ if __name__ == "__main__": else: print "Making CHM file for manual..." if VERSION == None: - makeManualCHM("panda3d-manual.chm", "manual", "Panda3D Manual") + makeManualCHM("manual.chm", "manual", "Panda3D Manual") else: - makeManualCHM("panda3d-%s-manual.chm" % VERSION, "manual", "Panda3D %s Manual" % VERSION) + makeManualCHM("manual-%s.chm" % VERSION, "manual", "Panda3D %s Manual" % VERSION) if not os.path.isdir("reference"): print "No directory named 'reference' found" else: print "Making CHM file for API reference..." if VERSION == None: - makeReferenceCHM("panda3d-reference.chm", "reference", "Panda3D Reference") + makeReferenceCHM("reference.chm", "reference", "Panda3D Reference") else: - makeReferenceCHM("panda3d-%s-reference.chm" % VERSION, "reference", "Panda3D %s Reference" % VERSION) + makeReferenceCHM("reference-%s.chm" % VERSION, "reference", "Panda3D %s Reference" % VERSION) print "Done!" + diff --git a/doc/makepanda/makepanda.py b/doc/makepanda/makepanda.py index f7812a3186..70e351ce77 100755 --- a/doc/makepanda/makepanda.py +++ b/doc/makepanda/makepanda.py @@ -1039,7 +1039,7 @@ else: sys.exit("Cannot find the 'direct' tree") """ if (PkgSkip("PYTHON")==0): - ConditionalWriteFile('built/direct/__init__.py', DIRECTINIT) + ConditionalWriteFile(GetOutputDir()+'/direct/__init__.py', DIRECTINIT) ########################################################################################## # diff --git a/doc/makepanda/makepandacore.py b/doc/makepanda/makepandacore.py index 417584e262..2c92a4ed9e 100644 --- a/doc/makepanda/makepandacore.py +++ b/doc/makepanda/makepandacore.py @@ -460,6 +460,17 @@ def GetRegistryKey(path, subkey): _winreg.CloseKey(key) return k1 +def GetProgramFiles(): + if (os.environ.has_key("PROGRAMFILES")): + return os.environ["PROGRAMFILES"] + elif (os.path.isdir("C:\\Program Files")): + return "C:\\Program Files" + elif (os.path.isdir("D:\\Program Files")): + return "D:\\Program Files" + elif (os.path.isdir("E:\\Program Files")): + return "E:\\Program Files" + return 0 + ######################################################################## ## ## Parsing Compiler Option Lists @@ -847,10 +858,16 @@ def SdkLocateMSPlatform(): if (platsdk == 0): platsdk=GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1","InstallationFolder") - if (platsdk == 0 and os.path.isdir("C:\\Program Files\\Microsoft Visual Studio 9\\VC\\PlatformSDK")): - platsdk = "C:\\Program Files\\Microsoft Visual Studio 9\\VC\\PlatformSDK\\" + if (platsdk == 0 and os.path.isdir(os.path.join(GetProgramFiles(), "Microsoft Platform SDK for Windows Server 2003 R2"))): + platsdk = os.path.join(GetProgramFiles(), "Microsoft Platform SDK for Windows Server 2003 R2") + + # Doesn't work with the Express versions, so we're checking for the "atlmfc" dir, which is not in the Express + if (platsdk == 0 and os.path.isdir(os.path.join(GetProgramFiles(), "Microsoft Visual Studio 9\\VC\\atlmfc"))): + platsdk = os.path.join(GetProgramFiles(), "Microsoft Visual Studio 9\\VC\\PlatformSDK") if (platsdk != 0): + if (not platsdk.endswith("//")): + platsdk += "//" SDK["MSPLATFORM"] = platsdk def SdkLocateMacOSX(): @@ -930,7 +947,9 @@ def SetupVisualStudioEnviron(): AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "VC\\bin") AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE") AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\include") + AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include") AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib") + AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin") AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include") AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl") AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib") diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index a415c257fa..13eff6cca4 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -22,6 +22,18 @@ #include "dtool_config.h" +/* Make sure WIN32 and WIN32_VC are defined when using MSVC */ +#ifdef _WIN32 +#ifndef WIN32 +#define WIN32 +#endif +#ifdef _MSC_VER +#ifndef WIN32_VC +#define WIN32_VC +#endif +#endif +#endif + #ifdef WIN32_VC /* These warning pragmas must appear before anything else for VC++ to respect them. Sheesh. */