Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAlexis Christoforides <alexis@thenull.net>2015-12-10 02:05:32 +0300
committerAlexis Christoforides <alexis@thenull.net>2015-12-17 21:45:20 +0300
commit48cf6194d0a7731210e09c29e4e9ebbe8df6358b (patch)
tree4814f2c24ae0732f76760835faa3309010070068 /mcs
parent3e40c70cf4510a02e8deb6ca3076a07df1a3aab2 (diff)
[mkbundle] Allow overriding linked Mono library path
Diffstat (limited to 'mcs')
-rwxr-xr-xmcs/tools/mkbundle/mkbundle.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs
index 89bab52384c..e24b924e761 100755
--- a/mcs/tools/mkbundle/mkbundle.cs
+++ b/mcs/tools/mkbundle/mkbundle.cs
@@ -495,11 +495,11 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
if (static_link) {
compilerArgs.Add("/MT");
- monoFile = monoPath + @"\lib\mono-2.0.lib";
+ monoFile = LocateFile (monoPath + @"\lib\mono-2.0.lib");
}
else {
compilerArgs.Add("/MD");
- monoFile = monoPath + @"\lib\mono-2.0.dll";
+ monoFile = LocateFile (monoPath + @"\lib\mono-2.0.dll");
}
compilerArgs.Add(temp_c);
@@ -835,4 +835,15 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
}
return val;
}
+
+ static string LocateFile(string default_path)
+ {
+ var override_path = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(default_path));
+ if (File.Exists(override_path))
+ return override_path;
+ else if (File.Exists(default_path))
+ return default_path;
+ else
+ throw new FileNotFoundException(default_path);
+ }
}