summaryrefslogtreecommitdiff
path: root/rld-config.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-08-04 09:19:55 +1000
committerChris Johns <chrisj@rtems.org>2014-08-04 09:19:55 +1000
commit28884db485eba2b580d8da526e190f903b2e6174 (patch)
tree6cd24717823743f18041b6113351ff6a3468d3b4 /rld-config.cpp
parent482ca38073a878814640089086c0ba262e80e4cd (diff)
rtems-tld: Add trace configuration support.
Extend the configuration support to provide the needed configuration required to generate the C stub support.
Diffstat (limited to 'rld-config.cpp')
-rw-r--r--rld-config.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/rld-config.cpp b/rld-config.cpp
index b6b84c2..b197e5d 100644
--- a/rld-config.cpp
+++ b/rld-config.cpp
@@ -25,7 +25,6 @@
#include <errno.h>
#include <rld-config.h>
-#include <rld.h>
#include <SimpleIni.h>
@@ -127,6 +126,45 @@ namespace rld
}
}
+
+ void
+ config::includes (const section& sec, bool must_exist)
+ {
+ bool have_includes = false;
+
+ try
+ {
+ const rld::config::record& rec = sec.get_record ("include");
+
+ have_includes = true;
+
+ /*
+ * Include records are a path which we can just load.
+ *
+ * @todo Add a search path. See 'rld::files' for details. We can default
+ * the search path to the install $prefix of this tool and we can
+ * then provide a default set of function signatures for RTEMS
+ * APIs.
+ */
+
+ for (rld::config::items::const_iterator ri = rec.items.begin ();
+ ri != rec.items.end ();
+ ++ri)
+ {
+ load ((*ri).text);
+ }
+ }
+ catch (rld::error re)
+ {
+ /*
+ * No include records, must be all inlined. If we have includes it must
+ * be another error so throw it.
+ */
+ if (have_includes || (!have_includes && must_exist))
+ throw;
+ }
+ }
+
const section&
config::get_section (const std::string& name) const
{