summaryrefslogtreecommitdiff
path: root/rld.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-09 08:40:13 +1000
committerChris Johns <chrisj@rtems.org>2014-09-09 08:40:13 +1000
commit6cfee6a10df3b3d5d4fd5de55215506641dd82c9 (patch)
tree30588ef72eb4712a10206f3e8c763c57ea953815 /rld.cpp
parent42f6be76c9b79c4501ed766177e634bbe44198d4 (diff)
linkers: If no RTEMS path is provied see if the prefix can be used.
Diffstat (limited to 'rld.cpp')
-rw-r--r--rld.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/rld.cpp b/rld.cpp
index ca29297..fe11c06 100644
--- a/rld.cpp
+++ b/rld.cpp
@@ -39,6 +39,15 @@
namespace rld
{
static int verbose_level = 0;
+
+ /**
+ * The program's command line.
+ */
+ static std::string cmdline;
+
+ /**
+ * The program name as set by the caller.
+ */
static std::string progname;
/**
@@ -206,6 +215,24 @@ namespace rld
}
void
+ set_cmdline (int argc, char* argv[])
+ {
+ cmdline.clear ();
+ for (int arg = 0; arg < argc; ++arg)
+ {
+ std::string a = argv[arg];
+ cmdline += ' ' + a;
+ }
+ cmdline = rld::trim (cmdline);
+ }
+
+ const std::string
+ get_cmdline ()
+ {
+ return cmdline;
+ }
+
+ void
set_progname (const std::string& progname_)
{
progname = rld::path::path_abs (progname_);
@@ -233,10 +260,9 @@ namespace rld
get_prefix ()
{
std::string pp = get_program_path ();
- std::cout << "PP=" << pp << std::endl;
if (rld::path::basename (pp) == "bin")
- pp = rld::path::dirname (pp);
- return pp;
+ return rld::path::dirname (pp);
+ return "";
}
void