summaryrefslogtreecommitdiff
path: root/volk/gen/make_environment_init_c.py
diff options
context:
space:
mode:
authorTom Rondeau2011-08-27 16:44:32 -0400
committerTom Rondeau2011-08-27 16:44:32 -0400
commit54881f8803d4f796dde2af031e6f1a37df9445f1 (patch)
treeb1e4e6c34004f22a29c03815ed3ae49065693dce /volk/gen/make_environment_init_c.py
parent50cde24aea52d66d69313a490f7eab78a5085849 (diff)
parentf4cc7884c608a7ec1969e68b73e12cdbcc26145c (diff)
downloadgnuradio-54881f8803d4f796dde2af031e6f1a37df9445f1.tar.gz
gnuradio-54881f8803d4f796dde2af031e6f1a37df9445f1.tar.bz2
gnuradio-54881f8803d4f796dde2af031e6f1a37df9445f1.zip
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'volk/gen/make_environment_init_c.py')
-rw-r--r--volk/gen/make_environment_init_c.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/volk/gen/make_environment_init_c.py b/volk/gen/make_environment_init_c.py
new file mode 100644
index 000000000..263d5bcd1
--- /dev/null
+++ b/volk/gen/make_environment_init_c.py
@@ -0,0 +1,32 @@
+from xml.dom import minidom
+
+def make_environment_init_c(dom) :
+ tempstring = "";
+ tempstring = tempstring + "/*this file is auto_generated by volk_register.py*/\n\n";
+ tempstring = tempstring + "#include<volk/volk_environment_init.h>\n"
+ for domarch in dom:
+ arch = str(domarch.attributes["name"].value);
+ incs = domarch.getElementsByTagName("include");
+ for inc in incs:
+ my_inc = str(inc.firstChild.data);
+ tempstring = tempstring + "#ifdef LV_HAVE_" + arch.swapcase() + "\n";
+ tempstring = tempstring + "#include<" + my_inc + ">\n";
+ tempstring = tempstring + "#endif\n"
+ tempstring = tempstring + '\n\n';
+ tempstring = tempstring + "void volk_environment_init(){\n"
+
+ for domarch in dom:
+ arch = str(domarch.attributes["name"].value);
+ envs = domarch.getElementsByTagName("environment");
+ for env in envs:
+ cmd = str(env.firstChild.data);
+ tempstring = tempstring + "#ifdef LV_HAVE_" + arch.swapcase() + "\n";
+ tempstring = tempstring + " " + cmd + "\n";
+ tempstring = tempstring + "#endif\n"
+
+ tempstring = tempstring + "}\n";
+ return tempstring;
+
+
+
+