diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-16 19:28:27 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-03-16 19:28:27 (GMT) |
commit | 0199071e626b5d06d4291d28a05761b495b0fc4c (patch) | |
tree | 8434d5337a73db92a3b9b260902e0b78338ef50d | |
parent | 2838a65f140269fad84fb61129cf0080d714244f (diff) | |
download | swift-0199071e626b5d06d4291d28a05761b495b0fc4c.zip swift-0199071e626b5d06d4291d28a05761b495b0fc4c.tar.bz2 |
Install Swiften if requested.
-rw-r--r-- | BuildTools/SCons/SConstruct | 2 | ||||
-rw-r--r-- | Swiften/Config/SConscript | 7 | ||||
-rw-r--r-- | Swiften/SConscript | 23 |
3 files changed, 25 insertions, 7 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index f1f437a..c2c34d0 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -209,6 +209,8 @@ env["TEST_IGNORE_RESULT"] = "ignore_test_result" in ARGUMENTS env["DIST"] = "dist" in ARGUMENTS or env.GetOption("clean") if ARGUMENTS.get("SWIFT_INSTALLDIR", "") : env["SWIFT_INSTALLDIR"] = Dir(ARGUMENTS["SWIFT_INSTALLDIR"]).abspath +if ARGUMENTS.get("SWIFTEN_INSTALLDIR", "") : + env["SWIFTEN_INSTALLDIR"] = Dir(ARGUMENTS["SWIFTEN_INSTALLDIR"]).abspath ################################################################################ diff --git a/Swiften/Config/SConscript b/Swiften/Config/SConscript index b162e69..933e4a3 100644 --- a/Swiften/Config/SConscript +++ b/Swiften/Config/SConscript @@ -1,3 +1,5 @@ +import os.path + Import("env") def replaceSwiftenPath(input) : @@ -29,6 +31,9 @@ config_env.MergeFlags(config_env["SWIFTEN_FLAGS"]) config_env.MergeFlags(config_env["BOOST_FLAGS"]) config_env.MergeFlags(config_env["PLATFORM_FLAGS"]) config_env.WriteVal("swiften-config.h", config_env.Value(config_flags)) -config_env.Program("swiften-config", [ +swiften_config = config_env.Program("swiften-config", [ "swiften-config.cpp" ]) + +if swiften_env.get("SWIFTEN_INSTALLDIR", "") : + swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "bin"), swiften_config) diff --git a/Swiften/SConscript b/Swiften/SConscript index 7b8991e..7ee459e 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -178,9 +178,9 @@ if env["SCONS_STAGE"] == "build" : ]) if ARGUMENTS.get("swiften_dll", False) : - myenv.SharedLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) + swiften_lib = myenv.SharedLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) else : - myenv.StaticLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) + swiften_lib = myenv.StaticLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"]) env.Append(UNITTEST_SOURCES = [ File("Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp"), @@ -304,20 +304,31 @@ if env["SCONS_STAGE"] == "build" : # Generate the Swiften header swiften_header = "#pragma once\n" + swiften_includes = [] top_path = env.Dir("..").abspath public_dirs = ["Avatars", "Base", "Chat", "Client", "Component", "Disco", "Entity", "Elements", "JID", "MUC", "Network", "Parser", "Presence", "Queries", "Roster", "Serializer", "StringCodecs", "TLS", "VCards"] for public_dir in public_dirs : for root, dirs, files in os.walk(env.Dir(public_dir).abspath) : if root.endswith("UnitTest") : continue - if root.endswith("OpenSSL") : - continue for file in files : if not file.endswith(".h") : continue + include = os.path.relpath(os.path.join(root, file), top_path) + swiften_includes.append(include) + if root.endswith("OpenSSL") : + continue if file.startswith("CAres") or file.startswith("LibXML") or file.startswith("Expat") : continue - swiften_header += "#include \"" + os.path.relpath(os.path.join(root, file), top_path) + "\"\n" + swiften_header += "#include <" + include + ">\n" + swiften_includes.append(include) for file in ["EventLoop/SimpleEventLoop.h"] : - swiften_header += "#include \"Swiften/" + file + "\"\n" + swiften_header += "#include <Swiften/" + file + ">\n" + swiften_includes.append("Swiften/" + file) swiften_env.WriteVal("Swiften.h", swiften_env.Value(swiften_header)) + + # Install swiften + if swiften_env.get("SWIFTEN_INSTALLDIR", "") : + swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib"), swiften_lib) + for include in swiften_includes : + swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "include", os.path.dirname(include)), "#/" + include) |