changeset 1338:99ebaa4dd414

Automated merge with http://hg.dsource.org/projects/ldc
author Christian Kamm <kamm incasoftware de>
date Sun, 10 May 2009 17:58:35 +0200
parents 4b2b2cd865e3 (current diff) b6e819244062 (diff)
children 2e98ddd72fa7
files
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gen/configfile.cpp	Sun May 10 17:31:56 2009 +0200
+++ b/gen/configfile.cpp	Sun May 10 17:58:35 2009 +0200
@@ -88,8 +88,17 @@
             int len = arr.getLength();
             for (int i=0; i<len; i++)
             {
-                const char* v = arr[i];
-                switches.push_back(v);
+                std::string v = arr[i];
+                
+                // replace binpathkey with binpath
+                std::string binpathkey = "%%ldcbinarypath%%";
+                sys::Path binpathgetter = sys::Path::GetMainExecutable(argv0, mainAddr);
+                binpathgetter.eraseComponent();
+                std::string binpath = binpathgetter.toString();
+                size_t p;
+                while (std::string::npos != (p = v.find(binpathkey)))
+                    v.replace(p, binpathkey.size(), binpath);
+                switches.push_back(strdup(v.c_str()));
             }
         }
 
--- a/ldc.conf.in	Sun May 10 17:31:56 2009 +0200
+++ b/ldc.conf.in	Sun May 10 17:58:35 2009 +0200
@@ -9,7 +9,7 @@
     switches = [
         "-I@RUNTIME_DIR@",
         "-I@RUNTIME_DIR@/lib/common",
-        "-L-L@PROJECT_BINARY_DIR@/../lib",
+        "-L-L%%ldcbinarydir%%/../lib",
         "-d-version=Tango",
         "-defaultlib=@RUNTIME_AIO@",
         "-debuglib=@RUNTIME_AIO@"