summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-07-14 08:13:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-07-14 13:08:36 (GMT)
commit003381f417caaae9918cd81fa53bcc0547caa4c9 (patch)
treec0571987e87a115e5a7ad03eca55db972f6686c6 /Swiften/SConscript
parent075c1f08245055e0060df2695e75bba54e697d36 (diff)
downloadswift-003381f417caaae9918cd81fa53bcc0547caa4c9.zip
swift-003381f417caaae9918cd81fa53bcc0547caa4c9.tar.bz2
Initial DLL support for Swiften.
All applications succesfully link against Swiften.dll.
Diffstat (limited to 'Swiften/SConscript')
-rw-r--r--Swiften/SConscript13
1 files changed, 8 insertions, 5 deletions
diff --git a/Swiften/SConscript b/Swiften/SConscript
index de67983..105a7f4 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -9,6 +9,7 @@ Import("env")
swiften_dep_modules = ["BOOST", "GCONF", "ICU", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT", "AVAHI", "LIBMINIUPNPC", "LIBNATPMP"]
if env["SCONS_STAGE"] == "flags" :
+ env["SWIFTEN_DLL"] = ARGUMENTS.get("swiften_dll")
env["SWIFTEN_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift")
version_match = re.match("(\d+)\.(\d+).*", env["SWIFTEN_VERSION"])
if version_match :
@@ -22,9 +23,9 @@ if env["SCONS_STAGE"] == "flags" :
env["SWIFTEN_LIBRARY_FILE"] = "Swiften"
env["SWIFTEN_LIBRARY_ALIASES"] = []
- if ARGUMENTS.get("swiften_dll", False) :
+ if env["SWIFTEN_DLL"] :
if env["PLATFORM"] == "win32" :
- pass
+ env["SWIFTEN_LIBRARY_FILE"] = "Swiften.dll"
elif env["PLATFORM"] == "darwin" :
env["SWIFTEN_LIBRARY_FILE"] = env.subst("Swiften.${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}")
env["SWIFTEN_LIBRARY_ALIASES"] = ["libSwiften.dylib", env.subst("libSwiften.${SWIFTEN_VERSION_MAJOR}.dylib")]
@@ -35,6 +36,8 @@ if env["SCONS_STAGE"] == "flags" :
swiften_env = env.Clone()
swiften_env["LIBPATH"] = [Dir(".")]
swiften_env["LIBS"] = [swiften_env["SWIFTEN_LIBRARY"]]
+ if not env["SWIFTEN_DLL"] :
+ swiften_env["CPPDEFINES"] = ["SWIFTEN_STATIC"]
dep_env = env.Clone()
for module in swiften_dep_modules :
if env.get(module + "_BUNDLED", False) :
@@ -63,11 +66,12 @@ if env["SCONS_STAGE"] == "flags" :
if env["SCONS_STAGE"] == "build" :
swiften_env = env.Clone()
+ swiften_env.Append(CPPDEFINES = ["SWIFTEN_BUILDING"])
for module in swiften_dep_modules :
swiften_env.UseFlags(swiften_env.get(module + "_FLAGS", {}))
swiften_env.UseFlags(swiften_env["PLATFORM_FLAGS"])
- if ARGUMENTS.get("swiften_dll", False) :
+ if swiften_env["SWIFTEN_DLL"] :
swiften_env.AddMethod(lambda e,s : e.SharedObject(s), "SwiftenObject")
swiften_env.AddMethod(lambda e,l,o : e.SharedLibrary(l,o), "SwiftenLibrary")
else :
@@ -233,7 +237,6 @@ if env["SCONS_STAGE"] == "build" :
"QA",
])
-
myenv = swiften_env.Clone()
if myenv["PLATFORM"] == "win32":
sources.append("StringCodecs/SHA1_Windows.cpp")
@@ -242,7 +245,7 @@ if env["SCONS_STAGE"] == "build" :
if myenv["PLATFORM"] != "darwin" and myenv["PLATFORM"] != "win32" and myenv.get("HAVE_GCONF", 0) :
env.MergeFlags(env["GCONF_FLAGS"])
- if ARGUMENTS.get("swiften_dll", False) :
+ if myenv["SWIFTEN_DLL"] :
if myenv["PLATFORM"] == "posix" :
myenv.Append(LINKFLAGS = ["-Wl,-soname,libSwiften.so.$SWIFTEN_VERSION_MAJOR"])
myenv["SHLIBSUFFIX"] = ""