Fix issues with pkg-config result not being read out properly always, resulting in gtk-stats not being built

This commit is contained in:
rdb 2009-11-27 19:40:09 +00:00
parent eb341f8a54
commit 3ccc0d4603
2 changed files with 3 additions and 2 deletions

View File

@ -4154,7 +4154,7 @@ if (PkgSkip("PANDATOOL")==0):
# DIRECTORY: pandatool/src/gtk-stats/
#
if (PkgSkip("PANDATOOL")==0 and (sys.platform.startswith("win") or PkgConfigHavePkg("gtk+-2.0"))):
if (PkgSkip("PANDATOOL")==0 and (sys.platform.startswith("win") or PkgSkip("GTK2")==0)):
if (sys.platform.startswith("win")):
OPTS=['DIR:pandatool/src/win-stats']
TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')

View File

@ -908,7 +908,8 @@ def PkgConfigHavePkg(pkgname, tool = "pkg-config"):
else:
return bool(LocateBinary(tool) != None)
result = handle.read().strip()
if handle.close() != 0:
returnval = handle.close()
if returnval != None and returnval != 0:
return False
return bool(len(result) > 0)