summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-17 11:13:43 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-19 07:03:46 (GMT)
commitb6e77a03685c8cca575c026b8b3ae5a86bb0f828 (patch)
tree4602d826ed00b20127f9355ed239dc687f34d8be /BuildTools/SCons/SConstruct
parente32154b0d6ad0c9c8d2bbd56a1f0b9f7b7c73c89 (diff)
downloadswift-contrib-b6e77a03685c8cca575c026b8b3ae5a86bb0f828.zip
swift-contrib-b6e77a03685c8cca575c026b8b3ae5a86bb0f828.tar.bz2
Fixed Linux compilation.
Diffstat (limited to 'BuildTools/SCons/SConstruct')
-rw-r--r--BuildTools/SCons/SConstruct37
1 files changed, 26 insertions, 11 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 0ee1d0e..9ad5277 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -328,6 +328,12 @@ def checkObjCHeader(context, header) :
if ARGUMENTS.get("force-configure", 0) :
SCons.SConf.SetCacheMode("force")
+def CheckPKG(context, name):
+ context.Message( 'Checking for package %s... ' % name )
+ ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
+ context.Result( ret )
+ return ret
+
conf = Configure(conf_env)
if not conf.CheckCXX() or not conf.CheckCC() :
@@ -425,17 +431,26 @@ if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" :
# GConf
env["HAVE_GCONF"] = 0
if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" :
- gconf_env = Environment()
- gconf_env.ParseConfig('pkg-config --cflags gconf-2.0 --libs gconf-2.0')
- conf = Configure(gconf_env)
- if conf.CheckCHeader("gconf/gconf-client.h") and conf.CheckLib("gconf-2") :
- env["HAVE_GCONF"] = 1
- env["GCONF_FLAGS"] = {
- "LIBS": gconf_env["LIBS"],
- "CCFLAGS": gconf_env["CCFLAGS"],
- "CPPPATH": gconf_env["CPPPATH"],
- "CPPDEFINES": gconf_env["CPPDEFINES"],
- }
+ gconf_env = conf_env.Clone()
+ conf = Configure(gconf_env, custom_tests = {"CheckPKG": CheckPKG})
+ if conf.CheckPKG("gconf-2.0") :
+ gconf_bare_env = Environment()
+ gconf_bare_env.ParseConfig('pkg-config --cflags gconf-2.0 --libs gconf-2.0')
+ gconf_flags = {
+ "LIBS": gconf_bare_env["LIBS"],
+ "CCFLAGS": gconf_bare_env["CCFLAGS"],
+ "CPPPATH": gconf_bare_env["CPPPATH"],
+ "CPPDEFINES": gconf_bare_env["CPPDEFINES"],
+ }
+ gconf_env.MergeFlags(gconf_flags)
+ if conf.CheckCHeader("gconf/gconf-client.h") and conf.CheckLib("gconf-2") :
+ env["HAVE_GCONF"] = 1
+ env["GCONF_FLAGS"] = {
+ "LIBS": gconf_env["LIBS"],
+ "CCFLAGS": gconf_env["CCFLAGS"],
+ "CPPPATH": gconf_env["CPPPATH"],
+ "CPPDEFINES": gconf_env["CPPDEFINES"],
+ }
conf.Finish()
# Sparkle