diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-10-08 18:18:49 +0300 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-10-08 18:19:11 +0300 |
commit | 2a54fff00b559f5e906142437fd8f642309ac321 (patch) | |
tree | c49fdbb8663c520becb45ef6e3e317d683089bd4 /main/build | |
parent | a81406eea84f5f8306eafdf6a4fe8f1eacb69ccb (diff) |
[Mac] Fixup to f1d43a688234d937111f87b640aec34a87de693f
Diffstat (limited to 'main/build')
-rw-r--r-- | main/build/MacOSX/monostub.m | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/main/build/MacOSX/monostub.m b/main/build/MacOSX/monostub.m index ab8398c1e8..b412a2f767 100644 --- a/main/build/MacOSX/monostub.m +++ b/main/build/MacOSX/monostub.m @@ -233,7 +233,7 @@ push_env (const char *variable, const char *value) setenv (variable, value, 1); } - //printf ("Updated the %s environment variable.\n", variable); + //printf ("Updated the %s environment variable with '%s'.\n", variable, value); return YES; } @@ -314,18 +314,20 @@ update_environment (const char *contentsDir) if ((value = str_append (contentsDir, "/MacOS"))) { char *compat; - + + char *value2 = str_append("/Libraries/Frameworks/Mono.framework/Commands:", value); + // Note: older versions of Xamarin Studio incorrectly set the PATH to the Resources dir instead of the MacOS dir // and older versions of mtouch relied on this broken behavior. if ((compat = str_append (contentsDir, "/Resources"))) { size_t compatlen = strlen (compat); - size_t valuelen = strlen (value); + size_t valuelen = strlen (value2); char *combined; if ((combined = malloc (compatlen + valuelen + 2))) { memcpy (combined, compat, compatlen); combined[compatlen] = ':'; - strcpy (combined + compatlen + 1, value); + strcpy (combined + compatlen + 1, value2); if (push_env ("PATH", combined)) updated = YES; @@ -339,15 +341,14 @@ update_environment (const char *contentsDir) free (compat); } else { - if (push_env ("PATH", value)) + if (push_env ("PATH", value2)) updated = YES; } - + free (value); + free (value2); } - if (push_env ("PATH", "/Library/Frameworks/Mono.framework/Commands")) - updated = YES; return updated; } |