mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Fixes for running makepanda with cygwin Python, fixes for compiling on 32-bits Windows for 64-bits Windows
This commit is contained in:
parent
f251e29237
commit
1b3e62ebb9
@ -262,12 +262,15 @@ def parseopts(args):
|
|||||||
SetTarget(target, target_arch)
|
SetTarget(target, target_arch)
|
||||||
|
|
||||||
is_win7 = False
|
is_win7 = False
|
||||||
if sys.platform.startswith("win"):
|
if GetHost() == "windows":
|
||||||
if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
|
if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
|
||||||
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
|
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
|
||||||
winver = sys.getwindowsversion()
|
|
||||||
if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
|
if sys.platform == "win32":
|
||||||
is_win7 = True
|
# Note: not available in cygwin.
|
||||||
|
winver = sys.getwindowsversion()
|
||||||
|
if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
|
||||||
|
is_win7 = True
|
||||||
if not is_win7:
|
if not is_win7:
|
||||||
PkgDisable("TOUCHINPUT")
|
PkgDisable("TOUCHINPUT")
|
||||||
|
|
||||||
@ -289,7 +292,7 @@ if ("LDFLAGS" in os.environ):
|
|||||||
LDFLAGS = LDFLAGS.strip()
|
LDFLAGS = LDFLAGS.strip()
|
||||||
|
|
||||||
os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
|
os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
|
||||||
if (sys.platform == "darwin" and OSXTARGET != None):
|
if (GetHost() == "darwin" and OSXTARGET != None):
|
||||||
os.environ["MACOSX_DEPLOYMENT_TARGET"] = OSXTARGET
|
os.environ["MACOSX_DEPLOYMENT_TARGET"] = OSXTARGET
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
@ -318,6 +321,8 @@ MAJOR_VERSION = VERSION[:3]
|
|||||||
if (P3DSUFFIX is None):
|
if (P3DSUFFIX is None):
|
||||||
P3DSUFFIX = MAJOR_VERSION
|
P3DSUFFIX = MAJOR_VERSION
|
||||||
|
|
||||||
|
outputdir_suffix = ""
|
||||||
|
|
||||||
if (RUNTIME or RTDIST):
|
if (RUNTIME or RTDIST):
|
||||||
# Compiling Maya/Max is pointless in rtdist build
|
# Compiling Maya/Max is pointless in rtdist build
|
||||||
for ver in MAYAVERSIONS + MAXVERSIONS:
|
for ver in MAYAVERSIONS + MAXVERSIONS:
|
||||||
@ -326,16 +331,20 @@ if (RUNTIME or RTDIST):
|
|||||||
if (DISTRIBUTOR.strip() == ""):
|
if (DISTRIBUTOR.strip() == ""):
|
||||||
exit("You must provide a valid distributor name when making a runtime or rtdist build!")
|
exit("You must provide a valid distributor name when making a runtime or rtdist build!")
|
||||||
|
|
||||||
if (not IsCustomOutputDir()):
|
outputdir_suffix += "_" + DISTRIBUTOR.strip()
|
||||||
if (RTDIST):
|
if (RUNTIME):
|
||||||
SetOutputDir("built_" + DISTRIBUTOR.strip())
|
outputdir_suffix += "_rt"
|
||||||
elif (RUNTIME):
|
|
||||||
SetOutputDir("built_" + DISTRIBUTOR.strip() + "_rt")
|
|
||||||
|
|
||||||
RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
|
RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
|
||||||
elif (DISTRIBUTOR == ""):
|
elif (DISTRIBUTOR == ""):
|
||||||
DISTRIBUTOR = "makepanda"
|
DISTRIBUTOR = "makepanda"
|
||||||
|
|
||||||
|
if not IsCustomOutputDir():
|
||||||
|
if GetTarget() == "windows" and GetTargetArch() == 'x64':
|
||||||
|
outputdir_suffix += '_x64'
|
||||||
|
|
||||||
|
SetOutputDir("built" + outputdir_suffix)
|
||||||
|
|
||||||
if (RUNTIME):
|
if (RUNTIME):
|
||||||
for pkg in PkgListGet():
|
for pkg in PkgListGet():
|
||||||
if pkg in ["GTK2"]:
|
if pkg in ["GTK2"]:
|
||||||
@ -628,7 +637,7 @@ if (COMPILER=="GCC"):
|
|||||||
|
|
||||||
if (PkgSkip("PYTHON")==0):
|
if (PkgSkip("PYTHON")==0):
|
||||||
IncDirectory("ALWAYS", SDK["PYTHON"])
|
IncDirectory("ALWAYS", SDK["PYTHON"])
|
||||||
if (sys.platform == "darwin"):
|
if (GetHost() == "darwin"):
|
||||||
if (PkgSkip("FREETYPE")==0):
|
if (PkgSkip("FREETYPE")==0):
|
||||||
IncDirectory("FREETYPE", "/usr/X11R6/include")
|
IncDirectory("FREETYPE", "/usr/X11R6/include")
|
||||||
IncDirectory("FREETYPE", "/usr/X11/include")
|
IncDirectory("FREETYPE", "/usr/X11/include")
|
||||||
@ -639,7 +648,7 @@ if (COMPILER=="GCC"):
|
|||||||
IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
|
IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
|
||||||
LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
|
LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
|
||||||
|
|
||||||
if (sys.platform.startswith("freebsd")):
|
if (GetHost() == "freebsd"):
|
||||||
IncDirectory("ALWAYS", "/usr/local/include")
|
IncDirectory("ALWAYS", "/usr/local/include")
|
||||||
LibDirectory("ALWAYS", "/usr/local/lib")
|
LibDirectory("ALWAYS", "/usr/local/lib")
|
||||||
|
|
||||||
@ -682,7 +691,7 @@ if (COMPILER=="GCC"):
|
|||||||
rocket_libs = ("RocketCore", "RocketControls")
|
rocket_libs = ("RocketCore", "RocketControls")
|
||||||
if (GetOptimize() <= 3):
|
if (GetOptimize() <= 3):
|
||||||
rocket_libs += ("RocketDebugger",)
|
rocket_libs += ("RocketDebugger",)
|
||||||
if (sys.platform != "darwin"):
|
if (GetHost() != "darwin"):
|
||||||
# We use a statically linked libboost_python on OSX
|
# We use a statically linked libboost_python on OSX
|
||||||
rocket_libs += ("boost_python",)
|
rocket_libs += ("boost_python",)
|
||||||
SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
|
SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
|
||||||
@ -692,7 +701,7 @@ if (COMPILER=="GCC"):
|
|||||||
SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
|
SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
|
||||||
SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
|
SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
|
||||||
SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
|
SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
|
||||||
if (RTDIST and sys.platform == "darwin" and "PYTHONVERSION" in SDK):
|
if (RTDIST and GetHost() == "darwin" and "PYTHONVERSION" in SDK):
|
||||||
# Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
|
# Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
|
||||||
SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config")
|
SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config")
|
||||||
elif("PYTHONVERSION" in SDK and not RUNTIME):
|
elif("PYTHONVERSION" in SDK and not RUNTIME):
|
||||||
@ -701,12 +710,12 @@ if (COMPILER=="GCC"):
|
|||||||
SmartPkgEnable("WX", tool = "wx-config")
|
SmartPkgEnable("WX", tool = "wx-config")
|
||||||
SmartPkgEnable("FLTK", "", ("fltk"), ("Fl/Fl.H"), tool = "fltk-config")
|
SmartPkgEnable("FLTK", "", ("fltk"), ("Fl/Fl.H"), tool = "fltk-config")
|
||||||
if (RUNTIME):
|
if (RUNTIME):
|
||||||
if (sys.platform == 'darwin'):
|
if (GetHost() == 'darwin'):
|
||||||
SmartPkgEnable("NPAPI", "", (), ("npapi.h"))
|
SmartPkgEnable("NPAPI", "", (), ("npapi.h"))
|
||||||
if not os.path.isdir(GetThirdpartyDir() + "npapi"):
|
if not os.path.isdir(GetThirdpartyDir() + "npapi"):
|
||||||
IncDirectory("NPAPI", "/System/Library/Frameworks/WebKit.framework/Headers")
|
IncDirectory("NPAPI", "/System/Library/Frameworks/WebKit.framework/Headers")
|
||||||
|
|
||||||
elif (sys.platform.startswith("freebsd")):
|
elif (GetHost() == "freebsd"):
|
||||||
SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("libxul/stable", "libxul/stable/npapi.h", "nspr/prtypes.h", "nspr"))
|
SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("libxul/stable", "libxul/stable/npapi.h", "nspr/prtypes.h", "nspr"))
|
||||||
else:
|
else:
|
||||||
SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("xulrunner-*/stable", "xulrunner-*/stable/npapi.h", "nspr*/prtypes.h", "nspr*"))
|
SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("xulrunner-*/stable", "xulrunner-*/stable/npapi.h", "nspr*/prtypes.h", "nspr*"))
|
||||||
@ -732,7 +741,7 @@ if (COMPILER=="GCC"):
|
|||||||
|
|
||||||
for pkg in MAYAVERSIONS:
|
for pkg in MAYAVERSIONS:
|
||||||
if (PkgSkip(pkg)==0 and (pkg in SDK)):
|
if (PkgSkip(pkg)==0 and (pkg in SDK)):
|
||||||
if (sys.platform == "darwin"):
|
if (GetHost() == "darwin"):
|
||||||
# Sheesh, Autodesk really can't make up their mind
|
# Sheesh, Autodesk really can't make up their mind
|
||||||
# regarding the location of the Maya devkit on OS X.
|
# regarding the location of the Maya devkit on OS X.
|
||||||
if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
|
if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
|
||||||
@ -807,7 +816,7 @@ if (COMPILER=="GCC"):
|
|||||||
IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
|
IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
|
||||||
IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
|
IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
|
||||||
LibDirectory("PHYSX", SDK["PHYSXLIBS"])
|
LibDirectory("PHYSX", SDK["PHYSXLIBS"])
|
||||||
if (sys.platform == "darwin"):
|
if (GetHost() == "darwin"):
|
||||||
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
|
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
|
||||||
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
|
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
|
||||||
else:
|
else:
|
||||||
@ -845,7 +854,7 @@ def printStatus(header,warnings):
|
|||||||
print("Makepanda: Omit Pkg:",tomit)
|
print("Makepanda: Omit Pkg:",tomit)
|
||||||
if (GENMAN): print("Makepanda: Generate API reference manual")
|
if (GENMAN): print("Makepanda: Generate API reference manual")
|
||||||
else : print("Makepanda: Don't generate API reference manual")
|
else : print("Makepanda: Don't generate API reference manual")
|
||||||
if (sys.platform == "win32" and not RTDIST):
|
if (GetHost() == "windows" and not RTDIST):
|
||||||
if INSTALLER: print("Makepanda: Build installer, using",COMPRESSOR)
|
if INSTALLER: print("Makepanda: Build installer, using",COMPRESSOR)
|
||||||
else : print("Makepanda: Don't build installer")
|
else : print("Makepanda: Don't build installer")
|
||||||
print("Makepanda: Version ID: "+VERSION)
|
print("Makepanda: Version ID: "+VERSION)
|
||||||
@ -1713,7 +1722,7 @@ def CompileAnything(target, inputs, opts, progress = None):
|
|||||||
# It must be a simple copy operation.
|
# It must be a simple copy operation.
|
||||||
ProgressOutput(progress, "Copying file", target)
|
ProgressOutput(progress, "Copying file", target)
|
||||||
CopyFile(target, infile)
|
CopyFile(target, infile)
|
||||||
if (origsuffix==".exe" and not sys.platform.startswith("win")):
|
if (origsuffix==".exe" and GetHost() != "windows"):
|
||||||
os.system("chmod +x \"%s\"" % target)
|
os.system("chmod +x \"%s\"" % target)
|
||||||
return
|
return
|
||||||
elif (target.endswith("pandac/PandaModules.py")):
|
elif (target.endswith("pandac/PandaModules.py")):
|
||||||
|
@ -241,7 +241,7 @@ def exit(msg = ""):
|
|||||||
|
|
||||||
def GetHost():
|
def GetHost():
|
||||||
"""Returns the host platform, ie. the one we're compiling on."""
|
"""Returns the host platform, ie. the one we're compiling on."""
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32' or sys.platform == 'cygwin':
|
||||||
# sys.platform is win32 on 64-bits Windows as well.
|
# sys.platform is win32 on 64-bits Windows as well.
|
||||||
return 'windows'
|
return 'windows'
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
@ -482,9 +482,10 @@ def oscmd(cmd, ignoreError = False):
|
|||||||
print(ColorText("red", "Process exited with exit status %d and signal code %d" % ((res & 0xFF00) >> 8, sig)))
|
print(ColorText("red", "Process exited with exit status %d and signal code %d" % ((res & 0xFF00) >> 8, sig)))
|
||||||
if (sig == signal.SIGINT):
|
if (sig == signal.SIGINT):
|
||||||
exit("keyboard interrupt")
|
exit("keyboard interrupt")
|
||||||
|
|
||||||
# Don't ask me where the 35584 or 34304 come from...
|
# Don't ask me where the 35584 or 34304 come from...
|
||||||
if (sig == signal.SIGSEGV or res == 35584 or res == 34304):
|
if (sig == signal.SIGSEGV or res == 35584 or res == 34304):
|
||||||
if (LocateBinary("gdb") and GetVerbose()):
|
if (LocateBinary("gdb") and GetVerbose() and GetHost() != "windows"):
|
||||||
print(ColorText("red", "Received SIGSEGV, retrieving traceback..."))
|
print(ColorText("red", "Received SIGSEGV, retrieving traceback..."))
|
||||||
os.system("gdb -batch -ex 'handle SIG33 pass nostop noprint' -ex 'set pagination 0' -ex 'run' -ex 'bt full' -ex 'info registers' -ex 'thread apply all backtrace' -ex 'quit' --args %s < /dev/null" % cmd)
|
os.system("gdb -batch -ex 'handle SIG33 pass nostop noprint' -ex 'set pagination 0' -ex 'run' -ex 'bt full' -ex 'info registers' -ex 'thread apply all backtrace' -ex 'quit' --args %s < /dev/null" % cmd)
|
||||||
else:
|
else:
|
||||||
@ -808,6 +809,7 @@ def CxxCalcDependencies(srcfile, ipath, ignore):
|
|||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
|
# Note: not supported on cygwin.
|
||||||
if sys.version_info >= (3, 0):
|
if sys.version_info >= (3, 0):
|
||||||
import winreg
|
import winreg
|
||||||
else:
|
else:
|
||||||
@ -1463,7 +1465,7 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
|
|||||||
for d, v in defs.values():
|
for d, v in defs.values():
|
||||||
DefSymbol(target_pkg, d, v)
|
DefSymbol(target_pkg, d, v)
|
||||||
return
|
return
|
||||||
elif (sys.platform == "darwin" and framework != None):
|
elif (GetHost() == "darwin" and framework != None):
|
||||||
if (os.path.isdir("/Library/Frameworks/%s.framework" % framework) or
|
if (os.path.isdir("/Library/Frameworks/%s.framework" % framework) or
|
||||||
os.path.isdir("/System/Library/Frameworks/%s.framework" % framework) or
|
os.path.isdir("/System/Library/Frameworks/%s.framework" % framework) or
|
||||||
os.path.isdir("/Developer/Library/Frameworks/%s.framework" % framework) or
|
os.path.isdir("/Developer/Library/Frameworks/%s.framework" % framework) or
|
||||||
@ -1599,7 +1601,7 @@ def GetSdkDir(sdkname, sdkkey = None):
|
|||||||
return sdir
|
return sdir
|
||||||
|
|
||||||
def SdkLocateDirectX( strMode = 'default' ):
|
def SdkLocateDirectX( strMode = 'default' ):
|
||||||
if (sys.platform != "win32"): return
|
if (GetHost() != "windows"): return
|
||||||
if strMode == 'default':
|
if strMode == 'default':
|
||||||
GetSdkDir("directx8", "DX8")
|
GetSdkDir("directx8", "DX8")
|
||||||
GetSdkDir("directx9", "DX9")
|
GetSdkDir("directx9", "DX9")
|
||||||
@ -1729,14 +1731,14 @@ def SdkLocateMaya():
|
|||||||
if (PkgSkip(ver)==0 and ver not in SDK):
|
if (PkgSkip(ver)==0 and ver not in SDK):
|
||||||
GetSdkDir(ver.lower().replace("x",""), ver)
|
GetSdkDir(ver.lower().replace("x",""), ver)
|
||||||
if (not ver in SDK):
|
if (not ver in SDK):
|
||||||
if (sys.platform == "win32"):
|
if (GetHost() == "windows"):
|
||||||
for dev in ["Alias|Wavefront","Alias","Autodesk"]:
|
for dev in ["Alias|Wavefront","Alias","Autodesk"]:
|
||||||
fullkey="SOFTWARE\\"+dev+"\\Maya\\"+key+"\\Setup\\InstallPath"
|
fullkey="SOFTWARE\\"+dev+"\\Maya\\"+key+"\\Setup\\InstallPath"
|
||||||
res = GetRegistryKey(fullkey, "MAYA_INSTALL_LOCATION", override64=False)
|
res = GetRegistryKey(fullkey, "MAYA_INSTALL_LOCATION", override64=False)
|
||||||
if (res != 0):
|
if (res != 0):
|
||||||
res = res.replace("\\", "/").rstrip("/")
|
res = res.replace("\\", "/").rstrip("/")
|
||||||
SDK[ver] = res
|
SDK[ver] = res
|
||||||
elif (sys.platform == "darwin"):
|
elif (GetHost() == "darwin"):
|
||||||
ddir = "/Applications/Autodesk/maya"+key
|
ddir = "/Applications/Autodesk/maya"+key
|
||||||
if (os.path.isdir(ddir)): SDK[ver] = ddir
|
if (os.path.isdir(ddir)): SDK[ver] = ddir
|
||||||
else:
|
else:
|
||||||
@ -1751,7 +1753,7 @@ def SdkLocateMaya():
|
|||||||
elif (os.path.isdir(ddir2)): SDK[ver] = ddir2
|
elif (os.path.isdir(ddir2)): SDK[ver] = ddir2
|
||||||
|
|
||||||
def SdkLocateMax():
|
def SdkLocateMax():
|
||||||
if (sys.platform != "win32"): return
|
if (GetHost() != "windows"): return
|
||||||
for version,key1,key2,subdir in MAXVERSIONINFO:
|
for version,key1,key2,subdir in MAXVERSIONINFO:
|
||||||
if (PkgSkip(version)==0):
|
if (PkgSkip(version)==0):
|
||||||
if (version not in SDK):
|
if (version not in SDK):
|
||||||
@ -1811,35 +1813,50 @@ def SdkLocatePython(force_use_sys_executable = False):
|
|||||||
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
SDK["PYTHONEXEC"] = os.path.realpath(sys.executable)
|
||||||
|
|
||||||
def SdkLocateVisualStudio():
|
def SdkLocateVisualStudio():
|
||||||
if (sys.platform != "win32"): return
|
if (GetHost() != "windows"): return
|
||||||
vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "10.0")
|
vcdir = GetRegistryKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "10.0")
|
||||||
if (vcdir != 0) and (vcdir[-4:] == "\\VC\\"):
|
if (vcdir != 0) and (vcdir[-4:] == "\\VC\\"):
|
||||||
vcdir = vcdir[:-3]
|
vcdir = vcdir[:-3]
|
||||||
SDK["VISUALSTUDIO"] = vcdir
|
SDK["VISUALSTUDIO"] = vcdir
|
||||||
|
|
||||||
|
elif (os.path.isfile("C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")):
|
||||||
|
SDK["VISUALSTUDIO"] = "C:\\Program Files\\Microsoft Visual Studio 10.0\\"
|
||||||
|
|
||||||
|
elif (os.path.isfile("C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\cl.exe")):
|
||||||
|
SDK["VISUALSTUDIO"] = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\"
|
||||||
|
|
||||||
elif "VCINSTALLDIR" in os.environ:
|
elif "VCINSTALLDIR" in os.environ:
|
||||||
vcdir = os.environ["VCINSTALLDIR"]
|
vcdir = os.environ["VCINSTALLDIR"]
|
||||||
if (vcdir[-3:] == "\\VC"):
|
if (vcdir[-3:] == "\\VC"):
|
||||||
vcdir = vcdir[:-2]
|
vcdir = vcdir[:-2]
|
||||||
elif (vcdir[-4:] == "\\VC\\"):
|
elif (vcdir[-4:] == "\\VC\\"):
|
||||||
vcdir = vcdir[:-3]
|
vcdir = vcdir[:-3]
|
||||||
|
|
||||||
SDK["VISUALSTUDIO"] = vcdir
|
SDK["VISUALSTUDIO"] = vcdir
|
||||||
|
|
||||||
def SdkLocateMSPlatform(strMode = 'default'):
|
def SdkLocateMSPlatform(strMode = 'default'):
|
||||||
if (sys.platform != "win32"): return
|
if (GetHost() != "windows"): return
|
||||||
platsdk = 0
|
platsdk = None
|
||||||
|
|
||||||
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
|
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
|
||||||
if (platsdk and not os.path.isdir(platsdk)):
|
if (platsdk and not os.path.isdir(platsdk)):
|
||||||
platsdk = 0
|
platsdk = None
|
||||||
|
|
||||||
|
if not platsdk:
|
||||||
|
# Most common location. Worth a try.
|
||||||
|
platsdk = "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1"
|
||||||
|
if not os.path.isdir(platsdk):
|
||||||
|
platsdk = None
|
||||||
|
|
||||||
if not platsdk:
|
if not platsdk:
|
||||||
exit("Couldn't find Windows SDK v7.1")
|
exit("Couldn't find Windows SDK v7.1")
|
||||||
|
|
||||||
if (not platsdk.endswith("\\")):
|
if not platsdk.endswith("\\"):
|
||||||
platsdk += "\\"
|
platsdk += "\\"
|
||||||
SDK["MSPLATFORM"] = platsdk
|
SDK["MSPLATFORM"] = platsdk
|
||||||
|
|
||||||
def SdkLocateMacOSX(osxtarget = None):
|
def SdkLocateMacOSX(osxtarget = None):
|
||||||
if (sys.platform != "darwin"): return
|
if (GetHost() != "darwin"): return
|
||||||
if (osxtarget != None):
|
if (osxtarget != None):
|
||||||
if (os.path.exists("/Developer/SDKs/MacOSX%su.sdk" % osxtarget)):
|
if (os.path.exists("/Developer/SDKs/MacOSX%su.sdk" % osxtarget)):
|
||||||
SDK["MACOSX"] = "/Developer/SDKs/MacOSX%su.sdk" % osxtarget
|
SDK["MACOSX"] = "/Developer/SDKs/MacOSX%su.sdk" % osxtarget
|
||||||
@ -1877,14 +1894,14 @@ def SdkLocatePhysX():
|
|||||||
|
|
||||||
# Try to find a PhysX installation on the system.
|
# Try to find a PhysX installation on the system.
|
||||||
for (ver, key) in PHYSXVERSIONINFO:
|
for (ver, key) in PHYSXVERSIONINFO:
|
||||||
if (sys.platform == "win32"):
|
if (GetHost() == "windows"):
|
||||||
folders = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Folders"
|
folders = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Folders"
|
||||||
for folder in ListRegistryValues(folders):
|
for folder in ListRegistryValues(folders):
|
||||||
if folder.endswith("NVIDIA PhysX SDK\\%s\\SDKs\\" % key) or \
|
if folder.endswith("NVIDIA PhysX SDK\\%s\\SDKs\\" % key) or \
|
||||||
folder.endswith("NVIDIA PhysX SDK\\%s_win\\SDKs\\" % key):
|
folder.endswith("NVIDIA PhysX SDK\\%s_win\\SDKs\\" % key):
|
||||||
SDK["PHYSX"] = folder
|
SDK["PHYSX"] = folder
|
||||||
return
|
return
|
||||||
elif (sys.platform.startswith("linux")):
|
elif (GetHost() == "linux"):
|
||||||
incpath = "/usr/include/PhysX/%s/SDKs" % key
|
incpath = "/usr/include/PhysX/%s/SDKs" % key
|
||||||
libpath = "/usr/lib/PhysX/%s" % key
|
libpath = "/usr/lib/PhysX/%s" % key
|
||||||
if (os.path.isdir(incpath) and os.path.isdir(libpath)):
|
if (os.path.isdir(incpath) and os.path.isdir(libpath)):
|
||||||
@ -1972,7 +1989,7 @@ def SdkAutoDisableDirectX():
|
|||||||
for ver in ["DX8","DX9","DIRECTCAM"]:
|
for ver in ["DX8","DX9","DIRECTCAM"]:
|
||||||
if (PkgSkip(ver)==0):
|
if (PkgSkip(ver)==0):
|
||||||
if (ver not in SDK):
|
if (ver not in SDK):
|
||||||
if (sys.platform.startswith("win")):
|
if (GetHost() == "windows"):
|
||||||
WARNINGS.append("I cannot locate SDK for "+ver)
|
WARNINGS.append("I cannot locate SDK for "+ver)
|
||||||
WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower())
|
WARNINGS.append("I have automatically added this command-line option: --no-"+ver.lower())
|
||||||
PkgDisable(ver)
|
PkgDisable(ver)
|
||||||
@ -1982,7 +1999,7 @@ def SdkAutoDisableDirectX():
|
|||||||
def SdkAutoDisableMaya():
|
def SdkAutoDisableMaya():
|
||||||
for (ver,key) in MAYAVERSIONINFO:
|
for (ver,key) in MAYAVERSIONINFO:
|
||||||
if (ver not in SDK) and (PkgSkip(ver)==0):
|
if (ver not in SDK) and (PkgSkip(ver)==0):
|
||||||
if (sys.platform == "win32"):
|
if (GetHost() == "windows"):
|
||||||
WARNINGS.append("The registry does not appear to contain a pointer to the "+ver+" SDK.")
|
WARNINGS.append("The registry does not appear to contain a pointer to the "+ver+" SDK.")
|
||||||
else:
|
else:
|
||||||
WARNINGS.append("I cannot locate SDK for "+ver)
|
WARNINGS.append("I cannot locate SDK for "+ver)
|
||||||
@ -1992,7 +2009,7 @@ def SdkAutoDisableMaya():
|
|||||||
def SdkAutoDisableMax():
|
def SdkAutoDisableMax():
|
||||||
for version,key1,key2,subdir in MAXVERSIONINFO:
|
for version,key1,key2,subdir in MAXVERSIONINFO:
|
||||||
if (PkgSkip(version)==0) and ((version not in SDK) or (version+"CS" not in SDK)):
|
if (PkgSkip(version)==0) and ((version not in SDK) or (version+"CS" not in SDK)):
|
||||||
if (sys.platform.startswith("win")):
|
if (GetHost() == "windows"):
|
||||||
if (version in SDK):
|
if (version in SDK):
|
||||||
WARNINGS.append("Your copy of "+version+" does not include the character studio SDK")
|
WARNINGS.append("Your copy of "+version+" does not include the character studio SDK")
|
||||||
else:
|
else:
|
||||||
@ -2033,25 +2050,37 @@ def SetupVisualStudioEnviron():
|
|||||||
exit("Could not find the Microsoft Platform SDK")
|
exit("Could not find the Microsoft Platform SDK")
|
||||||
os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC"
|
os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC"
|
||||||
os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"]
|
os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"]
|
||||||
target_suffix = ""
|
|
||||||
host_suffix = ""
|
|
||||||
target_arch = GetTargetArch()
|
|
||||||
if (target_arch == 'x64'):
|
|
||||||
target_suffix = "\\amd64"
|
|
||||||
if (GetHostArch() == 'x64'):
|
|
||||||
host_suffix = "\\amd64"
|
|
||||||
|
|
||||||
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "VC\\bin"+host_suffix)
|
# Determine the directories to look in based on the architecture.
|
||||||
|
arch = GetTargetArch()
|
||||||
|
bindir = ""
|
||||||
|
libdir = ""
|
||||||
|
if (arch == 'x64'):
|
||||||
|
bindir = 'amd64'
|
||||||
|
libdir = 'amd64'
|
||||||
|
elif (arch != 'x86'):
|
||||||
|
bindir = arch
|
||||||
|
libdir = arch
|
||||||
|
|
||||||
|
if (arch != 'x86' and GetHostArch() == 'x86'):
|
||||||
|
# Special version of the tools that run on x86.
|
||||||
|
bindir = 'x86_' + bindir
|
||||||
|
|
||||||
|
binpath = SDK["VISUALSTUDIO"] + "VC\\bin\\" + bindir
|
||||||
|
if not os.path.isdir(binpath):
|
||||||
|
exit("Couldn't find compilers in %s. You may need to install the Windows SDK 7.1 and the Visual C++ 2010 SP1 Compiler Update for Windows SDK 7.1.")
|
||||||
|
|
||||||
|
AddToPathEnv("PATH", binpath)
|
||||||
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE")
|
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE")
|
||||||
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\include")
|
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\include")
|
||||||
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include")
|
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include")
|
||||||
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib"+target_suffix)
|
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib\\" + libdir)
|
||||||
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib"+target_suffix)
|
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib\\" + libdir)
|
||||||
AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin")
|
AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc")
|
||||||
if (target_arch != 'x64'):
|
if (arch != 'x64'):
|
||||||
AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib")
|
AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib")
|
||||||
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT")
|
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT")
|
||||||
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC")
|
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC")
|
||||||
@ -2189,7 +2218,7 @@ def SetupBuildEnvironment(compiler):
|
|||||||
AddToPathEnv("PYTHONPATH", builtdir)
|
AddToPathEnv("PYTHONPATH", builtdir)
|
||||||
AddToPathEnv("PANDA_PRC_DIR", os.path.join(builtdir, "etc"))
|
AddToPathEnv("PANDA_PRC_DIR", os.path.join(builtdir, "etc"))
|
||||||
AddToPathEnv("PATH", os.path.join(builtdir, "bin"))
|
AddToPathEnv("PATH", os.path.join(builtdir, "bin"))
|
||||||
if (sys.platform.startswith("win")):
|
if (GetHost() == 'windows'):
|
||||||
AddToPathEnv("PATH", os.path.join(builtdir, "plugins"))
|
AddToPathEnv("PATH", os.path.join(builtdir, "plugins"))
|
||||||
AddToPathEnv("PYTHONPATH", os.path.join(builtdir, "bin"))
|
AddToPathEnv("PYTHONPATH", os.path.join(builtdir, "bin"))
|
||||||
else:
|
else:
|
||||||
@ -2275,7 +2304,7 @@ def CopyTree(dstdir, srcdir, omitCVS=True):
|
|||||||
if (not omitCVS or entry != "CVS"):
|
if (not omitCVS or entry != "CVS"):
|
||||||
CopyTree(dstpth, srcpth)
|
CopyTree(dstpth, srcpth)
|
||||||
else:
|
else:
|
||||||
if (GetHost() == 'windows'):
|
if sys.platform == 'win32':
|
||||||
cmd = 'xcopy /I/Y/E/Q "' + srcdir + '" "' + dstdir + '"'
|
cmd = 'xcopy /I/Y/E/Q "' + srcdir + '" "' + dstdir + '"'
|
||||||
else:
|
else:
|
||||||
cmd = 'cp -R -f ' + srcdir + ' ' + dstdir
|
cmd = 'cp -R -f ' + srcdir + ' ' + dstdir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user