From 4cc8cf04c8138c6488325b15317ab19c8183b371 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 28 Jan 2012 13:12:36 +0000 Subject: [PATCH] support for thirdparty packages with their own Python bindings --- makepanda/makepanda.py | 19 ++++++++++++------- makepanda/makepandacore.py | 5 +++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 62af166b98..a139f01b08 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -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/") diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 6b6dc2788a..3c085b6af7 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -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