updates
[mono.git] / mcs / tools / macpack / LOADER
1 #!/bin/sh
2 #
3 # This is a stub script that allows .apps to be relocatable on OSX but still
4 # find the managed assembly.
5 #
6 # You should never have to edit this file directly as its generated by the 
7 # bundle maker.
8 #
9
10 MWF_MODE=%MWF_MODE%
11 COCOASHARP_MODE=%COCOASHARP_MODE%
12
13 PWD=`pwd`
14 # Fetch the path relative to the launch point where this shell script exists.
15 APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
16
17 # Fetch the app name (its our own name)
18 APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] != "") {idx++} printf("%s.exe", patharr[idx]); }'`
19
20 # Setup the environment for MWF if needed
21 if [ "$MWF_MODE" -eq "1" ]; then
22         export MONO_MWF_USE_QUARTZ_BACKEND=1
23         export GDIPLUS_NOX=1
24 fi
25
26 # Setup the environment for Cocoa# if needed
27 if [ "$COCOASHARP_MODE" -eq "1" ]; then
28         export MONO_GDIP_USE_COCOA_BACKEND=1
29         export DYLD_LIBRARY_PATH=$PWD/$APP_PATH/Contents/Resources:$DYLD_LIBRARY_PATH
30 fi
31
32 cd $APP_PATH/Contents/Resources
33 mono $APP_NAME