mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Use EXT_SUFFIX for Python modules to prevent conflict when multiple Python 3 versions are installed on Ubuntu
This commit is contained in:
parent
cf11d46e26
commit
aa5f2685ab
@ -2851,6 +2851,17 @@ def GetOrigExt(x):
|
|||||||
def SetOrigExt(x, v):
|
def SetOrigExt(x, v):
|
||||||
ORIG_EXT[x] = v
|
ORIG_EXT[x] = v
|
||||||
|
|
||||||
|
def GetExtensionSuffix():
|
||||||
|
if sys.version_info >= (3, 0):
|
||||||
|
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||||
|
if suffix:
|
||||||
|
return suffix
|
||||||
|
target = GetTarget()
|
||||||
|
if target == 'windows':
|
||||||
|
return '.pyd'
|
||||||
|
else:
|
||||||
|
return '.so'
|
||||||
|
|
||||||
def CalcLocation(fn, ipath):
|
def CalcLocation(fn, ipath):
|
||||||
if fn.startswith("panda3d/") and fn.endswith(".py"):
|
if fn.startswith("panda3d/") and fn.endswith(".py"):
|
||||||
return OUTPUTDIR + "/" + fn
|
return OUTPUTDIR + "/" + fn
|
||||||
@ -2872,6 +2883,7 @@ def CalcLocation(fn, ipath):
|
|||||||
if (fn.endswith(".xml")): return CxxFindSource(fn, ipath)
|
if (fn.endswith(".xml")): return CxxFindSource(fn, ipath)
|
||||||
if (fn.endswith(".egg")): return OUTPUTDIR+"/models/"+fn
|
if (fn.endswith(".egg")): return OUTPUTDIR+"/models/"+fn
|
||||||
if (fn.endswith(".egg.pz")):return OUTPUTDIR+"/models/"+fn
|
if (fn.endswith(".egg.pz")):return OUTPUTDIR+"/models/"+fn
|
||||||
|
if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+GetExtensionSuffix()
|
||||||
if (target == 'windows'):
|
if (target == 'windows'):
|
||||||
if (fn.endswith(".def")): return CxxFindSource(fn, ipath)
|
if (fn.endswith(".def")): return CxxFindSource(fn, ipath)
|
||||||
if (fn.endswith(".rc")): return CxxFindSource(fn, ipath)
|
if (fn.endswith(".rc")): return CxxFindSource(fn, ipath)
|
||||||
@ -2880,7 +2892,6 @@ def CalcLocation(fn, ipath):
|
|||||||
if (fn.endswith(".res")): return OUTPUTDIR+"/tmp/"+fn
|
if (fn.endswith(".res")): return OUTPUTDIR+"/tmp/"+fn
|
||||||
if (fn.endswith(".tlb")): return OUTPUTDIR+"/tmp/"+fn
|
if (fn.endswith(".tlb")): return OUTPUTDIR+"/tmp/"+fn
|
||||||
if (fn.endswith(".dll")): return OUTPUTDIR+"/bin/"+fn[:-4]+dllext+".dll"
|
if (fn.endswith(".dll")): return OUTPUTDIR+"/bin/"+fn[:-4]+dllext+".dll"
|
||||||
if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+".pyd"
|
|
||||||
if (fn.endswith(".ocx")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".ocx"
|
if (fn.endswith(".ocx")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".ocx"
|
||||||
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".mll"
|
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".mll"
|
||||||
if (fn.endswith(".dlo")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".dlo"
|
if (fn.endswith(".dlo")): return OUTPUTDIR+"/plugins/"+fn[:-4]+dllext+".dlo"
|
||||||
@ -2897,7 +2908,6 @@ def CalcLocation(fn, ipath):
|
|||||||
if (fn.endswith(".plist")): return CxxFindSource(fn, ipath)
|
if (fn.endswith(".plist")): return CxxFindSource(fn, ipath)
|
||||||
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
||||||
if (fn.endswith(".dll")): return OUTPUTDIR+"/lib/"+fn[:-4]+".dylib"
|
if (fn.endswith(".dll")): return OUTPUTDIR+"/lib/"+fn[:-4]+".dylib"
|
||||||
if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+".so"
|
|
||||||
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
||||||
if (fn.endswith(".exe")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
if (fn.endswith(".exe")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
||||||
if (fn.endswith(".p3d")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
if (fn.endswith(".p3d")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
||||||
@ -2910,7 +2920,6 @@ def CalcLocation(fn, ipath):
|
|||||||
# On Android, we build the libraries into built/tmp, then copy them.
|
# On Android, we build the libraries into built/tmp, then copy them.
|
||||||
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
||||||
if (fn.endswith(".dll")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".so"
|
if (fn.endswith(".dll")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".so"
|
||||||
if (fn.endswith(".pyd")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".so"
|
|
||||||
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
||||||
if (fn.endswith(".plugin")):return OUTPUTDIR+"/plugins/"+fn[:-7]+dllext+".so"
|
if (fn.endswith(".plugin")):return OUTPUTDIR+"/plugins/"+fn[:-7]+dllext+".so"
|
||||||
if (fn.endswith(".exe")): return OUTPUTDIR+"/tmp/lib"+fn[:-4]+".so"
|
if (fn.endswith(".exe")): return OUTPUTDIR+"/tmp/lib"+fn[:-4]+".so"
|
||||||
@ -2919,7 +2928,6 @@ def CalcLocation(fn, ipath):
|
|||||||
else:
|
else:
|
||||||
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
if (fn.endswith(".obj")): return OUTPUTDIR+"/tmp/"+fn[:-4]+".o"
|
||||||
if (fn.endswith(".dll")): return OUTPUTDIR+"/lib/"+fn[:-4]+".so"
|
if (fn.endswith(".dll")): return OUTPUTDIR+"/lib/"+fn[:-4]+".so"
|
||||||
if (fn.endswith(".pyd")): return OUTPUTDIR+"/panda3d/"+fn[:-4]+".so"
|
|
||||||
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
if (fn.endswith(".mll")): return OUTPUTDIR+"/plugins/"+fn
|
||||||
if (fn.endswith(".plugin")):return OUTPUTDIR+"/plugins/"+fn[:-7]+dllext+".so"
|
if (fn.endswith(".plugin")):return OUTPUTDIR+"/plugins/"+fn[:-7]+dllext+".so"
|
||||||
if (fn.endswith(".exe")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
if (fn.endswith(".exe")): return OUTPUTDIR+"/bin/"+fn[:-4]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user