[xBuild] Fix Import elements with the combination of wildcards and absolute paths
[mono.git] / runtime / mono-wrapper.in
index e00f38dcf975a79906358541e8ecbe7bd1223818..18c8cb5e47b959b19d0c26b29a9f2bc42ae35cce 100644 (file)
@@ -1,4 +1,16 @@
 #! /bin/sh
-MONO_CFG_DIR='@mono_cfg_dir@'; export MONO_CFG_DIR
-r=@mono_build_root@
-exec "$r/libtool" --mode=execute "$r/@mono_runtime@" --config "$r/data/config" "$@"
+r='@mono_build_root@'
+MONO_CFG_DIR='@mono_cfg_dir@'
+PATH="$r/runtime/_tmpinst/bin:$PATH"
+MONO_SHARED_DIR=$r/runtime
+export MONO_CFG_DIR MONO_SHARED_DIR PATH
+if [ -n "@nacl_self_host@" ]; then
+  case "$@" in
+    # gacutil.exe and mdoc.exe require filesystem functionality not
+    # exposed in NaCl.
+    # mcs.exe was added to the list recently because mcs under NaCl
+    # no longer produces equivalent output. TODO: investigate
+    */mcs.exe* | */gacutil.exe* | */mdoc.exe* ) exec /usr/local/bin/mono "$@";;
+  esac
+fi
+exec "$r/libtool" --mode=execute "$r/@mono_runtime@" --config "@mono_cfg_dir@/mono/config" "$@"