summaryrefslogtreecommitdiffstats
blob: eae2e5c2ee0dffa7ebf2b1831db86981d6008534 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Import("env")

if env.get("LDNS_BUNDLED", False) :

    if env["PLATFORM"] == "win32" :
        cppflags = ["/I" + Dir("#/3rdParty/Ldns/src/ldns").abspath]
    else :
        cppflags = [("-isystem", Dir("#/3rdParty/Ldns/src/ldns").abspath)]


################################################################################
# Flags
################################################################################
    if env["SCONS_STAGE"] == "flags" :
        env["LDNS_FLAGS"] = {
                "CPPPATH": [Dir("src/ldns")],
                "CPPFLAGS": cppflags,
                "LIBPATH": [env.Dir(".")],
                "LIBS": ["Swiften_Ldns"],
            }
        if env["target"] == "android" :
            env["LDNS_FLAGS"]["CPPPATH"].append(Dir("src/android"))

################################################################################
# Build
################################################################################

    if env["SCONS_STAGE"] == "build" :
        myenv = env.Clone()
        myenv.Append(CPPDEFINES = [("LDNS_STATICLIB")])
        myenv.Append(CPPPATH = ["src/ldns", "."])
        if env["target"] == "android" :
            myenv.Append(CPPPATH = ["src/android"])
        myenv.UseFlags(env["OPENSSL_FLAGS"])

        env["LDNS_OBJECTS"] = myenv.SwiftenObject([
            "src/ldns/compat/b32_ntop.c",
            "src/ldns/compat/b32_pton.c",
            "src/ldns/compat/b64_ntop.c",
            "src/ldns/compat/b64_pton.c",
            "src/ldns/buffer.c",
            "src/ldns/dname.c",
            "src/ldns/dnssec_sign.c",
            "src/ldns/dnssec_verify.c",
            "src/ldns/dnssec_zone.c",
            "src/ldns/dnssec.c",
            "src/ldns/error.c",
            "src/ldns/higher.c",
            "src/ldns/host2str.c",
            "src/ldns/host2wire.c",
            "src/ldns/keys.c",
            "src/ldns/linktest.c",
            "src/ldns/net.c",
            "src/ldns/packet.c",
            "src/ldns/parse.c",
            "src/ldns/rbtree.c",
            "src/ldns/rdata.c",
            "src/ldns/resolver.c",
            "src/ldns/rr_functions.c",
            "src/ldns/rr.c",
            "src/ldns/sha1.c",
            "src/ldns/sha2.c",
            "src/ldns/str2host.c",
            "src/ldns/tsig.c",
            "src/ldns/update.c",
            "src/ldns/util.c",
            "src/ldns/wire2host.c",
            "src/ldns/zone.c",
        ])