diff options
Diffstat (limited to 'Swiften/SConscript')
-rw-r--r-- | Swiften/SConscript | 168 |
1 files changed, 140 insertions, 28 deletions
diff --git a/Swiften/SConscript b/Swiften/SConscript index 2e0b73b..29298ca 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -1,3 +1,3 @@ -import os, re, Version, os.path +import os, re, Version, os.path, time Import("env") @@ -7,7 +7,9 @@ Import("env") ################################################################################ -swiften_dep_modules = ["BOOST", "GCONF", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT", "AVAHI", "LIBMINIUPNPC", "LIBNATPMP"] +swiften_dep_modules = ["BOOST", "GCONF", "ICU", "LIBIDN", "ZLIB", "LDNS", "UNBOUND", "OPENSSL", "LIBXML", "EXPAT", "AVAHI", "LIBMINIUPNPC", "LIBNATPMP", "SQLITE"] +external_swiften_dep_modules = ["BOOST"] if env["SCONS_STAGE"] == "flags" : + env["SWIFTEN_DLL"] = env["swiften_dll"] env["SWIFTEN_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift") version_match = re.match("(\d+)\.(\d+).*", env["SWIFTEN_VERSION"]) @@ -23,7 +25,8 @@ if env["SCONS_STAGE"] == "flags" : env["SWIFTEN_LIBRARY_ALIASES"] = [] - if ARGUMENTS.get("swiften_dll", False) : + if env["SWIFTEN_DLL"] : if env["PLATFORM"] == "win32" : - pass + env["SWIFTEN_LIBRARY"] = env.subst("Swiften${SWIFTEN_VERSION_MAJOR}") + env["SWIFTEN_LIBRARY_FILE"] = env.subst("${SWIFTEN_LIBRARY}.dll") elif env["PLATFORM"] == "darwin" : env["SWIFTEN_LIBRARY_FILE"] = env.subst("Swiften.${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}") @@ -33,13 +36,29 @@ if env["SCONS_STAGE"] == "flags" : env["SWIFTEN_LIBRARY_ALIASES"] = ["libSwiften.so", env.subst("libSwiften.so.${SWIFTEN_VERSION_MAJOR}")] + if env["SWIFTEN_DLL"] : + env.AddMethod(lambda e,s : e.SharedObject(s), "SwiftenObject") + else : + env.AddMethod(lambda e,s : e.StaticObject(s), "SwiftenObject") + swiften_env = env.Clone() swiften_env["LIBPATH"] = [Dir(".")] + swiften_env["LIBRUNPATH"] = [Dir(".")] swiften_env["LIBS"] = [swiften_env["SWIFTEN_LIBRARY"]] + if not env["SWIFTEN_DLL"] : + swiften_env.Append(CPPDEFINES = ["SWIFTEN_STATIC"]) dep_env = env.Clone() for module in swiften_dep_modules : + module_flags = env.get(module + "_FLAGS", {}) if env.get(module + "_BUNDLED", False) : - swiften_env.UseFlags(env.get(module + "_FLAGS", {})) + if module in external_swiften_dep_modules : + swiften_env.UseFlags(module_flags) + else : + if module in external_swiften_dep_modules : + dep_env.UseFlags(module_flags) else : - dep_env.UseFlags(env.get(module + "_FLAGS", {})) + # Expose only libraries + dep_env.Append(LIBPATH = module_flags.get("LIBPATH", [])) + dep_env.Append(LIBS = module_flags.get("LIBS", [])) + dep_env.Append(FRAMEWORKS = module_flags.get("FRAMEWORKS", [])) dep_env.UseFlags(dep_env["PLATFORM_FLAGS"]) @@ -47,5 +66,4 @@ if env["SCONS_STAGE"] == "flags" : dep_env.Append(LIBS = ["Winscard"]) - for var, e in [("SWIFTEN_FLAGS", swiften_env), ("SWIFTEN_DEP_FLAGS", dep_env)] : env[var] = { @@ -54,8 +72,12 @@ if env["SCONS_STAGE"] == "flags" : "CPPFLAGS": e.get("CPPFLAGS", []), "LIBPATH": e.get("LIBPATH", []), + "LIBRUNPATH": e.get("LIBRUNPATH", []), "LIBS": e.get("LIBS", []), "FRAMEWORKS": e.get("FRAMEWORKS", []), } + if env["PLATFORM"] == "win32" : + env.Append(CPPDEFINES = [("_WIN32_WINNT","_WIN32_WINNT_VISTA") , ("NTDDI_VERSION","NTDDI_VISTA")]) + ################################################################################ # Build @@ -64,13 +86,15 @@ 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", {})) + if env.get(module + "_BUNDLED", False) : + swiften_env.Append(SWIFTEN_OBJECTS = env.get(module + "_OBJECTS", [])) swiften_env.UseFlags(swiften_env["PLATFORM_FLAGS"]) - if ARGUMENTS.get("swiften_dll", False) : - swiften_env.AddMethod(lambda e,s : e.SharedObject(s), "SwiftenObject") + if swiften_env["SWIFTEN_DLL"] : swiften_env.AddMethod(lambda e,l,o : e.SharedLibrary(l,o), "SwiftenLibrary") else : - swiften_env.AddMethod(lambda e,s : e.StaticObject(s), "SwiftenObject") + swiften_env.Append(CPPDEFINES = ["SWIFTEN_STATIC"]) swiften_env.AddMethod(lambda e,l,o : e.StaticLibrary(l,o), "SwiftenLibrary") Export("swiften_env") @@ -100,23 +124,41 @@ if env["SCONS_STAGE"] == "build" : "Elements/Presence.cpp", "Elements/Form.cpp", + "Elements/FormField.cpp", "Elements/StreamFeatures.cpp", "Elements/Element.cpp", + "Elements/ToplevelElement.cpp", "Elements/IQ.cpp", "Elements/Payload.cpp", + "Elements/PubSubPayload.cpp", + "Elements/PubSubOwnerPayload.cpp", + "Elements/PubSubEventPayload.cpp", "Elements/RosterItemExchangePayload.cpp", "Elements/RosterPayload.cpp", + "Elements/SecurityLabel.cpp", "Elements/Stanza.cpp", + "Elements/StanzaAck.cpp", "Elements/StatusShow.cpp", "Elements/StreamManagementEnabled.cpp", "Elements/StreamResume.cpp", "Elements/StreamResumed.cpp", + "Elements/UserLocation.cpp", + "Elements/UserTune.cpp", "Elements/VCard.cpp", "Elements/MUCOccupant.cpp", + "Elements/ResultSet.cpp", + "Elements/Forwarded.cpp", + "Elements/MAMResult.cpp", + "Elements/MAMQuery.cpp", + "Elements/MAMArchived.cpp", + "Elements/IsodeIQDelegation.cpp", "Entity/Entity.cpp", "Entity/PayloadPersister.cpp", "MUC/MUC.cpp", + "MUC/MUCImpl.cpp", "MUC/MUCManager.cpp", "MUC/MUCRegistry.cpp", "MUC/MUCBookmarkManager.cpp", + "PubSub/PubSubManager.cpp", + "PubSub/PubSubManagerImpl.cpp", "Queries/IQChannel.cpp", "Queries/IQHandler.cpp", @@ -185,4 +227,13 @@ if env["SCONS_STAGE"] == "build" : "Serializer/PayloadSerializers/DeliveryReceiptSerializer.cpp", "Serializer/PayloadSerializers/DeliveryReceiptRequestSerializer.cpp", + "Serializer/PayloadSerializers/UserLocationSerializer.cpp", + "Serializer/PayloadSerializers/UserTuneSerializer.cpp", + "Serializer/PayloadSerializers/WhiteboardSerializer.cpp", + "Serializer/PayloadSerializers/ResultSetSerializer.cpp", + "Serializer/PayloadSerializers/ForwardedSerializer.cpp", + "Serializer/PayloadSerializers/MAMResultSerializer.cpp", + "Serializer/PayloadSerializers/MAMQuerySerializer.cpp", + "Serializer/PayloadSerializers/MAMArchivedSerializer.cpp", + "Serializer/PayloadSerializers/IsodeIQDelegationSerializer.cpp", "Serializer/PresenceSerializer.cpp", "Serializer/StanzaSerializer.cpp", @@ -198,7 +249,36 @@ if env["SCONS_STAGE"] == "build" : "Session/BOSHSessionStream.cpp", "StringCodecs/Base64.cpp", - "StringCodecs/SHA256.cpp", - "StringCodecs/MD5.cpp", "StringCodecs/Hexify.cpp", + "Whiteboard/WhiteboardResponder.cpp", + "Whiteboard/WhiteboardSession.cpp", + "Whiteboard/IncomingWhiteboardSession.cpp", + "Whiteboard/OutgoingWhiteboardSession.cpp", + "Whiteboard/WhiteboardSessionManager.cpp", + "Whiteboard/WhiteboardServer.cpp", + "Whiteboard/WhiteboardClient.cpp", + "Elements/Whiteboard/WhiteboardColor.cpp", + "Whiteboard/WhiteboardTransformer.cpp", + ] + + elements = [ + "PubSub", "PubSubAffiliations", "PubSubAffiliation", "PubSubConfigure", "PubSubCreate", "PubSubDefault", + "PubSubItems", "PubSubItem", "PubSubOptions", "PubSubPublish", "PubSubRetract", "PubSubSubscribeOptions", + "PubSubSubscribe", "PubSubSubscriptions", "PubSubSubscription", "PubSubUnsubscribe", + + "PubSubEvent", "PubSubEventAssociate", "PubSubEventCollection", "PubSubEventConfiguration", "PubSubEventDelete", + "PubSubEventDisassociate", "PubSubEventItem", "PubSubEventItems", "PubSubEventPurge", "PubSubEventRedirect", + "PubSubEventRetract", "PubSubEventSubscription", + + "PubSubOwnerAffiliation", "PubSubOwnerAffiliations", "PubSubOwnerConfigure", "PubSubOwnerDefault", + "PubSubOwnerDelete", "PubSubOwnerPubSub", "PubSubOwnerPurge", "PubSubOwnerRedirect", + "PubSubOwnerSubscription", "PubSubOwnerSubscriptions", + + "PubSubError", + ] + for element in elements : + sources += [ + "Elements/" + element + ".cpp", + "Serializer/PayloadSerializers/" + element + "Serializer.cpp", + "Parser/PayloadParsers/" + element + "Parser.cpp", ] @@ -209,4 +289,5 @@ if env["SCONS_STAGE"] == "build" : "SASL", "TLS", + "Crypto", "EventLoop", "Parser", @@ -234,19 +315,29 @@ if env["SCONS_STAGE"] == "build" : ]) - myenv = swiften_env.Clone() - if myenv["PLATFORM"] == "win32": - sources.append("StringCodecs/SHA1_Windows.cpp") - else: - sources.append("StringCodecs/SHA1.cpp") - 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"] = "" elif myenv["PLATFORM"] == "darwin" : - myenv.Append(LINKFLAGS = ["-Wl,-install_name,libSwiften.so.$SWIFTEN_VERSION_MAJOR", "-Wl,-compatibility_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}", "-Wl,-current_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}"]) + myenv.Append(LINKFLAGS = ["-Wl,-install_name,${SHLIBPREFIX}Swiften.${SWIFTEN_VERSION_MAJOR}${SHLIBSUFFIX}", "-Wl,-compatibility_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}", "-Wl,-current_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}"]) + elif myenv["PLATFORM"] == "win32" : + res_env = myenv.Clone() + res_env.Append(CPPDEFINES = [ + ("SWIFTEN_LIBRARY_FILE", "\"\\\"${SWIFTEN_LIBRARY_FILE}\\\"\""), + ("SWIFTEN_COPYRIGHT_YEAR", "\"\\\"2010-%s\\\"\"" % str(time.localtime()[0])), + ("SWIFTEN_VERSION_MAJOR", "${SWIFTEN_VERSION_MAJOR}"), + ("SWIFTEN_VERSION_MINOR", "${SWIFTEN_VERSION_MINOR}"), + ("SWIFTEN_VERSION_PATCH", "${SWIFTEN_VERSION_PATCH}"), + ]) + res = res_env.RES("Swiften.rc") + # For some reason, SCons isn't picking up the dependency correctly + # Adding it explicitly until i figure out why + res_env.Depends(res, "Version.h") + sources += res + swiften_lib = myenv.SwiftenLibrary(swiften_env["SWIFTEN_LIBRARY_FILE"], sources + swiften_env["SWIFTEN_OBJECTS"]) def symlink(env, target, source) : @@ -261,4 +352,5 @@ if env["SCONS_STAGE"] == "build" : File("Avatars/UnitTest/VCardAvatarManagerTest.cpp"), File("Avatars/UnitTest/CombinedAvatarProviderTest.cpp"), + File("Avatars/UnitTest/AvatarManagerImplTest.cpp"), File("Base/UnitTest/IDGeneratorTest.cpp"), File("Base/UnitTest/SimpleIDGeneratorTest.cpp"), @@ -266,8 +358,11 @@ if env["SCONS_STAGE"] == "build" : File("Base/UnitTest/DateTimeTest.cpp"), File("Base/UnitTest/ByteArrayTest.cpp"), + File("Base/UnitTest/URLTest.cpp"), + File("Base/UnitTest/PathTest.cpp"), File("Chat/UnitTest/ChatStateNotifierTest.cpp"), # File("Chat/UnitTest/ChatStateTrackerTest.cpp"), File("Client/UnitTest/ClientSessionTest.cpp"), File("Client/UnitTest/NickResolverTest.cpp"), + File("Client/UnitTest/ClientBlockListManagerTest.cpp"), File("Compress/UnitTest/ZLibCompressorTest.cpp"), File("Compress/UnitTest/ZLibDecompressorTest.cpp"), @@ -292,4 +387,5 @@ if env["SCONS_STAGE"] == "build" : File("LinkLocal/UnitTest/LinkLocalServiceTest.cpp"), File("MUC/UnitTest/MUCTest.cpp"), + File("MUC/UnitTest/MockMUC.cpp"), File("Network/UnitTest/HostAddressTest.cpp"), File("Network/UnitTest/ConnectorTest.cpp"), @@ -299,6 +395,8 @@ if env["SCONS_STAGE"] == "build" : File("Network/UnitTest/BOSHConnectionTest.cpp"), File("Network/UnitTest/BOSHConnectionPoolTest.cpp"), + File("Parser/PayloadParsers/UnitTest/BlockParserTest.cpp"), File("Parser/PayloadParsers/UnitTest/BodyParserTest.cpp"), File("Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/DiscoItemsParserTest.cpp"), File("Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp"), File("Parser/PayloadParsers/UnitTest/FormParserTest.cpp"), @@ -326,6 +424,13 @@ if env["SCONS_STAGE"] == "build" : File("Parser/PayloadParsers/UnitTest/MUCUserPayloadParserTest.cpp"), File("Parser/PayloadParsers/UnitTest/DeliveryReceiptParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/IdleParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/ResultSetParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/ForwardedParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/MAMResultParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/MAMQueryParserTest.cpp"), + File("Parser/PayloadParsers/UnitTest/MAMArchivedParserTest.cpp"), File("Parser/UnitTest/BOSHBodyExtractorTest.cpp"), File("Parser/UnitTest/AttributeMapTest.cpp"), + File("Parser/UnitTest/EnumParserTest.cpp"), File("Parser/UnitTest/IQParserTest.cpp"), File("Parser/UnitTest/GenericPayloadTreeParserTest.cpp"), @@ -351,4 +456,5 @@ if env["SCONS_STAGE"] == "build" : File("Roster/UnitTest/XMPPRosterSignalHandler.cpp"), File("Serializer/PayloadSerializers/UnitTest/PayloadsSerializer.cpp"), + File("Serializer/PayloadSerializers/UnitTest/BlockSerializerTest.cpp"), File("Serializer/PayloadSerializers/UnitTest/CapsInfoSerializerTest.cpp"), File("Serializer/PayloadSerializers/UnitTest/FormSerializerTest.cpp"), @@ -375,4 +481,12 @@ if env["SCONS_STAGE"] == "build" : File("Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp"), File("Serializer/PayloadSerializers/UnitTest/DeliveryReceiptSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/IdleSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/ResultSetSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/ForwardedSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/MAMResultSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/MAMQuerySerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/MAMArchivedSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/PubSubItemSerializerTest.cpp"), + File("Serializer/PayloadSerializers/UnitTest/PubSubItemsSerializerTest.cpp"), File("Serializer/UnitTest/StreamFeaturesSerializerTest.cpp"), File("Serializer/UnitTest/AuthSuccessSerializerTest.cpp"), @@ -387,13 +501,11 @@ if env["SCONS_STAGE"] == "build" : File("StreamStack/UnitTest/XMPPLayerTest.cpp"), File("StringCodecs/UnitTest/Base64Test.cpp"), - File("StringCodecs/UnitTest/SHA1Test.cpp"), - File("StringCodecs/UnitTest/SHA256Test.cpp"), - File("StringCodecs/UnitTest/MD5Test.cpp"), File("StringCodecs/UnitTest/HexifyTest.cpp"), - File("StringCodecs/UnitTest/HMACTest.cpp"), File("StringCodecs/UnitTest/PBKDF2Test.cpp"), File("TLS/UnitTest/ServerIdentityVerifierTest.cpp"), File("TLS/UnitTest/CertificateTest.cpp"), File("VCards/UnitTest/VCardManagerTest.cpp"), + File("Whiteboard/UnitTest/WhiteboardServerTest.cpp"), + File("Whiteboard/UnitTest/WhiteboardClientTest.cpp"), ]) @@ -416,17 +528,17 @@ if env["SCONS_STAGE"] == "build" : swiften_includes.append(include) # Private modules - if root.endswith("Config") or root.endswith("Compress") : + if root.endswith("Config") : continue # Library-specfifc private modules - if root.endswith("OpenSSL") or root.endswith("Cocoa") or root.endswith("Qt") or root.endswith("IDN") or root.endswith("Avahi") or root.endswith("Bonjour") : + if root.endswith("OpenSSL") or root.endswith("Cocoa") or root.endswith("Qt") or root.endswith("Avahi") or root.endswith("Bonjour") : continue # Library-specific files - if file.startswith("Schannel") or file.startswith("CAPI") or file.startswith("LibXML") or file.startswith("Expat") or file.startswith("GConf") or file.startswith("MacOSX") or file.startswith("Windows") or file.endswith("_Windows.h") or file.startswith("SQLite") or file.startswith("NATPMP") or file.startswith("MiniUPnP") : + if file.endswith("_Private.h") or file.startswith("Schannel") or file.startswith("CAPI") or file.startswith("MacOSX") or file.startswith("Windows") or file.endswith("_Windows.h") or file.startswith("SQLite") or file == "ICUConverter.h" or file == "UnboundDomainNameResolver.h" : continue # Specific headers we don't want to globally include - if file == "Swiften.h" or file == "foreach.h" or file == "Log.h" or file == "format.h" or file == "CompressionLayer.h": + if file == "Swiften.h" or file == "foreach.h" or file == "Log.h" or file == "format.h" : continue swiften_header += "#include <" + include + ">\n" |