dump: import code from ndndump repository

Code is copied from ndndump:commit:c266031924d723b9a73be29ebb66fd6db26aade5,
with minor changes for removing trailing whitespaces.
Build script is rewritten.

refs #2692

Change-Id: I07eec2f87542f1328b851cc2c4e5c9b6279db7da
diff --git a/tools/dump/wscript b/tools/dump/wscript
new file mode 100644
index 0000000..28e58b6
--- /dev/null
+++ b/tools/dump/wscript
@@ -0,0 +1,42 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+top = '../..'
+
+ATTRIBUTE_CHECK='''
+#include <stdlib.h>
+
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+  exit(1);
+}
+
+int
+main(int argc, char** argv)
+{
+  foo();
+}
+'''
+
+def configure(conf):
+    conf.check(header_name="inttypes.h", mandatory=False)
+    conf.check(header_name="stdint.h", mandatory=False)
+    conf.check(header_name="sys/bitypes.h", mandatory=False)
+    conf.check(fragment=ATTRIBUTE_CHECK, msg="Checking for __attribute__", mandatory=False)
+
+    conf.check(header_name=["sys/types.h", "sys/time.h", "time.h"], define="TIME_WITH_SYS_TIME",
+               mandatory=False)
+
+    conf.check_cfg(path='pcap-config',
+                   package="libpcap", args=['--libs', '--cflags'],
+                   uselib_store='PCAP', mandatory=True)
+
+def build(bld):
+    bld.program(
+        features='cxx',
+        target='../../bin/ndndump',
+        source=bld.path.ant_glob(['*.cpp']),
+        includes='.',
+        use='core-objects BOOST PCAP',
+        )