From 8cdfd96779722099e98aad3d9f2e66dfcb7e281a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 5 Mar 2011 10:42:35 +0100
Subject: Detect pthread for platform flags.


diff --git a/3rdParty/Boost/SConscript b/3rdParty/Boost/SConscript
index 86871fd..3c815b6 100644
--- a/3rdParty/Boost/SConscript
+++ b/3rdParty/Boost/SConscript
@@ -39,9 +39,7 @@ elif env.get("BOOST_BUNDLED", False) :
 				"LIBPATH": [Dir(".")],
 				"LIBS": ["Swiften_Boost"]
 			}
-		if env["PLATFORM"] != "win32" :
-			env["BOOST_FLAGS"]["LIBS"] += ["pthread"]
-		else :
+		if env["PLATFORM"] == "win32" :
 			env["BOOST_FLAGS"]["CPPDEFINES"] += [("_WIN32_WINNT", "0x0501")]
 			if env["PLATFORM"] == "cygwin" :
 				env["BOOST_FLAGS"]["CPPDEFINES"] += ["__USE_W32_SOCKETS"]
diff --git a/3rdParty/Lua/SConscript b/3rdParty/Lua/SConscript
index c3e2801..3baa2d8 100644
--- a/3rdParty/Lua/SConscript
+++ b/3rdParty/Lua/SConscript
@@ -34,7 +34,6 @@ if env.get("LUA_BUNDLED", False) :
 		# Remove warn flags
 		myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])
 		myenv.MergeFlags(myenv["LUA_FLAGS"])
-		myenv.MergeFlags(myenv["PLATFORM_FLAGS"])
 		myenv.StaticLibrary("Swiften_Lua", [
 			"src/lapi.c",
 			"src/lcode.c",
@@ -71,6 +70,7 @@ if env.get("LUA_BUNDLED", False) :
 		if lua_env.get("HAVE_READLINE", False) :
 			lua_env.Append(CPPDEFINES = ["LUA_USE_READLINE"])
 			lua_env.MergeFlags(lua_env["READLINE_FLAGS"])
+		lua_env.MergeFlags(myenv["PLATFORM_FLAGS"])
 		lua_env.Program("lua", [
 				"src/linit.c",
 				"src/lua.c",
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 0c1cf94..9b50071 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -331,10 +331,13 @@ else :
 if conf.CheckLib("resolv") :
 	env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["resolv"]
 
+if env["PLATFORM"] != "win32" :
+	if conf.CheckLib("pthread") :
+		env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["pthread"]
+
 if conf.CheckLib("dl") :
 	env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["dl"]
 
-
 if conf.CheckLib("c") :
 	env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["c"]
 
-- 
cgit v0.10.2-6-g49f6