support for thirdparty packages with their own Python bindings

This commit is contained in:
rdb 2012-01-28 13:12:36 +00:00
parent 72af325f2b
commit 4cc8cf04c8
2 changed files with 17 additions and 7 deletions

View File

@ -2145,13 +2145,18 @@ ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
##########################################################################################
for pkg in PkgListGet():
if (PkgSkip(pkg)==0):
if (COMPILER == "MSVC"):
if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/bin")):
CopyAllFiles(GetOutputDir()+"/bin/",GetThirdpartyDir()+pkg.lower()+"/bin/")
if (COMPILER == "LINUX"):
if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/lib")):
CopyAllFiles(GetOutputDir()+"/lib/",GetThirdpartyDir()+pkg.lower()+"/lib/")
if (PkgSkip(pkg)!=0):
continue
if (COMPILER == "MSVC"):
if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/bin")):
CopyAllFiles(GetOutputDir()+"/bin/",GetThirdpartyDir()+pkg.lower()+"/bin/")
if (PkgSkip("PYTHON")==0 and os.path.exists(GetThirdpartyDir()+pkg.lower()+"/bin/"+SDK["PYTHONVERSION"])):
CopyAllFiles(GetOutputDir()+"/bin/",GetThirdpartyDir()+pkg.lower()+"/bin/"+SDK["PYTHONVERSION"]+"/")
if (COMPILER == "LINUX"):
if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/lib")):
CopyAllFiles(GetOutputDir()+"/lib/",GetThirdpartyDir()+pkg.lower()+"/lib/")
if (PkgSkip("PYTHON")==0 and os.path.exists(GetThirdpartyDir()+pkg.lower()+"/lib/"+SDK["PYTHONVERSION"])):
CopyAllFiles(GetOutputDir()+"/lib/",GetThirdpartyDir()+pkg.lower()+"/lib/"+SDK["PYTHONVERSION"]+"/")
if (COMPILER=="MSVC"):
CopyAllFiles(GetOutputDir()+"/bin/", GetThirdpartyDir()+"extras"+"/bin/")

View File

@ -1185,6 +1185,9 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
if (os.path.isdir(GetThirdpartyDir() + pkg.lower())):
IncDirectory(target_pkg, GetThirdpartyDir() + pkg.lower() + "/include")
LibDirectory(target_pkg, GetThirdpartyDir() + pkg.lower() + "/lib")
if (PkgSkip("PYTHON") == 0):
LibDirectory(target_pkg, GetThirdpartyDir() + pkg.lower() + "/lib/" + SDK["PYTHONVERSION"])
# TODO: check for a .pc file in the lib/pkg-config/ dir
if (tool != None and os.path.isfile(GetThirdpartyDir() + pkg.lower() + "/bin/" + tool)):
tool = GetThirdpartyDir() + pkg.lower() + "/bin/" + tool
@ -1193,6 +1196,7 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
for i, j in PkgConfigGetDefSymbols(None, tool).items():
DefSymbol(target_pkg, i, j)
return
for l in libs:
libname = l
if (l.startswith("lib")):
@ -1202,6 +1206,7 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
len(glob.glob(GetThirdpartyDir() + pkg.lower() + "/lib/lib%s.*" % libname)) == 0):
libname = "panda" + libname
LibName(target_pkg, "-l" + libname)
for d, v in defs.values():
DefSymbol(target_pkg, d, v)
return