summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-12-28 11:48:49 +0200
committerHanoh Haim <hhaim@cisco.com>2015-12-28 11:48:49 +0200
commitc6e339496ef514eb672376ee22f6b23bbdd1ea13 (patch)
tree36aa7d5998adc8d96351be72793bd4eb9d43e23d
parent2eb43187d6fa58232436464b0dcd722992ab2a71 (diff)
fix gitignore
-rw-r--r--.gitignore6
-rw-r--r--linux_dpdk/c_dumbpreproc.py61
2 files changed, 67 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 61cc588a..7831fde9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,12 @@
linux_dpdk/.waf*
linux_dpdk/build*
linux_dpdk/version*
+linux_dpdk/trex-64.bz2
+linux_dpdk/trex-64.bz2
+linux_dpdk/*.html
+linux_dpdk/cov-int/*
+
+
linux/.waf*
linux/build*
linux/version*
diff --git a/linux_dpdk/c_dumbpreproc.py b/linux_dpdk/c_dumbpreproc.py
new file mode 100644
index 00000000..9dc60155
--- /dev/null
+++ b/linux_dpdk/c_dumbpreproc.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2006-2010 (ita)
+
+"""
+Dumb C/C++ preprocessor for finding dependencies
+
+It will look at all include files it can find after removing the comments, so the following
+will always add the dependency on both "a.h" and "b.h"::
+
+ #include "a.h"
+ #ifdef B
+ #include "b.h"
+ #endif
+ int main() {
+ return 0;
+ }
+
+To use::
+
+ def configure(conf):
+ conf.load('compiler_c')
+ conf.load('c_dumbpreproc')
+"""
+
+import re, sys, os, string, traceback
+from waflib import Logs, Build, Utils, Errors
+from waflib.Logs import debug, error
+from waflib.Tools import c_preproc
+
+re_inc = re.compile(
+ '^[ \t]*(#|%:)[ \t]*(include)[ \t]*[<"](.*)[>"][\r\t ]*$',
+ re.IGNORECASE | re.MULTILINE)
+
+def lines_includes(node):
+ code = node.read()
+ if c_preproc.use_trigraphs:
+ for (a, b) in c_preproc.trig_def: code = code.split(a).join(b)
+ code = c_preproc.re_nl.sub('', code)
+ code = c_preproc.re_cpp.sub(c_preproc.repl, code)
+ return [(m.group(2), m.group(3)) for m in re.finditer(re_inc, code)]
+
+parser = c_preproc.c_parser
+class dumb_parser(parser):
+ def addlines(self, node):
+ if node in self.nodes[:-1]:
+ return
+ self.currentnode_stack.append(node.parent)
+ self.lines = lines_includes(node) + [(c_preproc.POPFILE, '')] + self.lines
+
+ def start(self, node, env):
+ self.addlines(node)
+ while self.lines:
+ (x, y) = self.lines.pop(0)
+ if x == c_preproc.POPFILE:
+ self.currentnode_stack.pop()
+ continue
+ self.tryfind(y)
+
+c_preproc.c_parser = dumb_parser
+