mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Python-version-independent
This commit is contained in:
parent
bc647ff264
commit
ffcfcf0b19
@ -1293,20 +1293,15 @@ for pkg in PkgListGet():
|
||||
if (COMPILER == "LINUX"):
|
||||
if (os.path.exists(THIRDPARTYLIBS+pkg.lower()+"/lib")):
|
||||
CopyAllFiles(GetOutputDir()+"/lib/",THIRDPARTYLIBS+pkg.lower()+"/lib/")
|
||||
|
||||
if (COMPILER=="MSVC"):
|
||||
CopyAllFiles(GetOutputDir()+"/bin/", THIRDPARTYLIBS+"extras"+"/bin/")
|
||||
if (sys.platform == "win32"):
|
||||
if (PkgSkip("PYTHON")==0):
|
||||
(arch, osName) = platform.architecture()
|
||||
archName = "win64"
|
||||
if arch=='32bit': archName = "win32"
|
||||
if os.path.isdir('thirdparty/' + archName + '/win-python'):
|
||||
CopyFile(GetOutputDir()+'/bin/python25.dll', 'thirdparty/' + archName + '/win-python/python25.dll')
|
||||
CopyTree(GetOutputDir()+'/python', 'thirdparty/' + archName + '/win-python')
|
||||
else:
|
||||
CopyFile(GetOutputDir()+'/bin/python25.dll', 'thirdparty/win-python/python25.dll')
|
||||
CopyTree(GetOutputDir()+'/python', 'thirdparty/win-python')
|
||||
ConditionalWriteFile(GetOutputDir()+'/python/panda.pth',"..\n../bin\n")
|
||||
pydll = "/" + SDK["PYTHONVERSION"].replace(".", "") + ".dll"
|
||||
CopyFile(GetOutputDir()+"/bin"+pydll, SDK["PYTHON"]+pydll)
|
||||
CopyTree(GetOutputDir()+"/python", SDK["PYTHON"])
|
||||
ConditionalWriteFile(GetOutputDir()+"/python/panda.pth", "..\n../bin\n")
|
||||
|
||||
########################################################################
|
||||
##
|
||||
|
@ -868,12 +868,23 @@ def SdkLocatePython():
|
||||
if (PkgSkip("PYTHON")==0):
|
||||
if (sys.platform == "win32"):
|
||||
(arch, osName) = platform.architecture()
|
||||
if arch=='32bit':
|
||||
if arch == "32bit":
|
||||
SDK["PYTHON"] = "thirdparty/win32/win-python"
|
||||
else:
|
||||
SDK["PYTHON"] = "thirdparty/win64/win-python"
|
||||
|
||||
SDK["PYTHONVERSION"]="python2.5"
|
||||
if (not os.path.exists(SDK["PYTHON"])):
|
||||
SDK["PYTHON"] = "thirdparty/win-python"
|
||||
if (not os.path.exists(SDK["PYTHON"]+"/python.exe")):
|
||||
exit("Could not find thirdparty/win-python/python.exe!")
|
||||
|
||||
os.system(SDK["PYTHON"].replace("/", "\\") + "\\python.exe -V > "+OUTPUTDIR+"/tmp/pythonversion 2>&1")
|
||||
pv=ReadFile(OUTPUTDIR+"/tmp/pythonversion")
|
||||
if (pv.startswith("Python ")==0):
|
||||
exit("python -V did not produce the expected output")
|
||||
pv = pv[7:10]
|
||||
SDK["PYTHONVERSION"]="python"+pv
|
||||
|
||||
elif (sys.platform == "darwin"):
|
||||
if not SDK.has_key("MACOSX"): SdkLocateMacOSX()
|
||||
if (os.path.isdir("%s/System/Library/Frameworks/Python.framework" % SDK["MACOSX"])):
|
||||
@ -883,6 +894,7 @@ def SdkLocatePython():
|
||||
SDK["PYTHONVERSION"] = "python"+pv
|
||||
else:
|
||||
exit("Could not find the python framework!")
|
||||
|
||||
else:
|
||||
os.system("python -V > "+OUTPUTDIR+"/tmp/pythonversion 2>&1")
|
||||
pv=ReadFile(OUTPUTDIR+"/tmp/pythonversion")
|
||||
|
Loading…
x
Reference in New Issue
Block a user