diff options
author | Tobias Markmann <tm@ayena.de> | 2013-08-13 17:17:40 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2013-08-13 17:40:43 (GMT) |
commit | 437e70ff9d254b11a30a4926010a91543d7f282c (patch) | |
tree | 123ef9476d89ad32643356ea11c52d212d2d03ad /3rdParty/Ldns | |
parent | 3eefe28a2f6cc1e33d9d2b0bad7f9c6f2146352f (diff) | |
download | swift-437e70ff9d254b11a30a4926010a91543d7f282c.zip swift-437e70ff9d254b11a30a4926010a91543d7f282c.tar.bz2 |
Adding basic support for Android and Unbound (No IPv6 yet).
Change-Id: I1d74324515b20e0dc3d0ef4aa2f556fea7b4bee3
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.s
Diffstat (limited to '3rdParty/Ldns')
-rw-r--r-- | 3rdParty/Ldns/01_andoird_compilation_fixes.diff | 15 | ||||
-rw-r--r-- | 3rdParty/Ldns/SConscript | 70 | ||||
-rwxr-xr-x | 3rdParty/Ldns/prepare_ldns.sh | 5 |
3 files changed, 90 insertions, 0 deletions
diff --git a/3rdParty/Ldns/01_andoird_compilation_fixes.diff b/3rdParty/Ldns/01_andoird_compilation_fixes.diff new file mode 100644 index 0000000..9d6ec08 --- /dev/null +++ b/3rdParty/Ldns/01_andoird_compilation_fixes.diff @@ -0,0 +1,15 @@ +--- 3rdParty/Ldns/src/ldns/ldns/ldns.h 2013-04-12 14:30:16.000000000 +0200 ++++ 3rdParty/Ldns/src/ldns/ldns/ldns.h 2013-04-12 14:30:48.000000000 +0200 +@@ -123,6 +123,12 @@ + #include <ldns/sha1.h> + #include <ldns/sha2.h> + ++#ifdef __ANDROID__ ++#ifndef in_port_t ++#define in_port_t uint16_t ++#endif ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif diff --git a/3rdParty/Ldns/SConscript b/3rdParty/Ldns/SConscript new file mode 100644 index 0000000..a43bde7 --- /dev/null +++ b/3rdParty/Ldns/SConscript @@ -0,0 +1,70 @@ +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", + ]) diff --git a/3rdParty/Ldns/prepare_ldns.sh b/3rdParty/Ldns/prepare_ldns.sh new file mode 100755 index 0000000..e057301 --- /dev/null +++ b/3rdParty/Ldns/prepare_ldns.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +curl -o src/ldns-1.6.16.tar.gz http://www.nlnetlabs.nl/downloads/ldns/ldns-1.6.16.tar.gz +cd src +tar -xf ldns-1.6.16.tar.gz +mv ldns-1.6.16 ldns
\ No newline at end of file |