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

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--main/build/MacOSX/Makefile.am10
-rw-r--r--main/build/MacOSX/monostub.c26
3 files changed, 36 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 1e8fe687b2..4d716baa38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ obj/
/main/tests/tmp
/main/tests/config
/main/tests/UnitTests/test-results
+/main/build/MacOSX/monostub
/main/contrib/bin/
/main/contrib/*/*/bin/
/local-libs
diff --git a/main/build/MacOSX/Makefile.am b/main/build/MacOSX/Makefile.am
index 13034aa6cf..7402b65b7e 100644
--- a/main/build/MacOSX/Makefile.am
+++ b/main/build/MacOSX/Makefile.am
@@ -18,11 +18,14 @@ render.exe: render.cs
dmg: render.exe app
./make-dmg-bundle.sh
+monostub: monostub.c
+ gcc -Wall -m32 monostub.c -o monostub -framework CoreFoundation
+
clean-local:
rm -rf MonoDevelop.app
rm -f MonoDevelop*.dmg
-app:
+app: monostub
@echo ""
@echo "Creating directories in app bundle"
@echo ""
@@ -122,6 +125,11 @@ app:
cp -r MDMonitor.app $(MACOS)
+# Mono stubs to make the process name and bundle location correct
+ mkdir -p "$(MACOS)/bin"
+ cp -f monostub "$(MACOS)/bin/monodevelop"
+ cp -f monostub "$(MACOS)/bin/mdtool"
+
# update revision in updateinfo
@echo ""
@echo "Updating build information"
diff --git a/main/build/MacOSX/monostub.c b/main/build/MacOSX/monostub.c
new file mode 100644
index 0000000000..ec19f43156
--- /dev/null
+++ b/main/build/MacOSX/monostub.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <dlfcn.h>
+
+typedef int (* MonoMain) (int argc, char **argv);
+
+int main (int argc, char **argv)
+{
+ void *libmono = dlopen ("libmono-2.0.dylib", RTLD_LAZY);
+
+ if (libmono == NULL) {
+ libmono = dlopen ("libmono-0.dylib", RTLD_LAZY);
+ if (libmono == NULL) {
+ printf ("Could not load libmono\n");
+ exit (1);
+ }
+ }
+
+ MonoMain mono_main = (MonoMain) dlsym (libmono, "mono_main");
+ if (mono_main == NULL) {
+ printf ("Could not load mono_main\n");
+ exit (2);
+ }
+
+ return mono_main (argc, argv);
+}