diff options
author | Michael Hutchinson <mhutchinson@novell.com> | 2009-04-29 05:11:28 +0400 |
---|---|---|
committer | Michael Hutchinson <mhutchinson@novell.com> | 2009-04-29 05:11:28 +0400 |
commit | c4bc3f8cb995cf4ad54da5d2f077ad9b06b54214 (patch) | |
tree | af70c85d087efa752e43a222fdc9d6cc77380748 /main/build | |
parent | 36bd4404b3dc552864ea5c2f314e5c5be72402fd (diff) |
* build/MacOSX/Makefile.am: Better build deps.
* build/MacOSX/mdtool: Simpler launch script.
* build/MacOSX/monodevelop: Simpler launch script. Detect Mono version
and show error dialog if Mono not found or too old.
svn path=/trunk/monodevelop/; revision=132921
Diffstat (limited to 'main/build')
-rw-r--r-- | main/build/MacOSX/Makefile.am | 2 | ||||
-rwxr-xr-x | main/build/MacOSX/mdtool | 62 | ||||
-rwxr-xr-x | main/build/MacOSX/monodevelop | 97 |
3 files changed, 56 insertions, 105 deletions
diff --git a/main/build/MacOSX/Makefile.am b/main/build/MacOSX/Makefile.am index 6eebb443ad..10aadd413d 100644 --- a/main/build/MacOSX/Makefile.am +++ b/main/build/MacOSX/Makefile.am @@ -19,7 +19,7 @@ clean-local: rm -rf MonoDevelop.dmg rm -f MonoDevelop.app.zip -MonoDevelop.app: ../AddIns/* ../AddIns/*/* ../AddIns/*/*/* ../bin/* ../data/*/* ../locale/*/*/* +MonoDevelop.app: ../AddIns/* ../AddIns/*/* ../AddIns/*/*/* ../bin/* ../data/*/* ../locale/*/*/* mdtool monodevelop mkdir -p $(MAC_APP_DIR)/Contents/{MacOS,Resources} mkdir -p $(MAC_APP_DIR)/Contents/MacOS/{lib,share} mkdir -p $(MAC_APP_LIB_DIR) diff --git a/main/build/MacOSX/mdtool b/main/build/MacOSX/mdtool index e9a2c7e301..fdac1ebeb6 100755 --- a/main/build/MacOSX/mdtool +++ b/main/build/MacOSX/mdtool @@ -3,65 +3,29 @@ # Author: Marc Christensen (mchristensen@novell.com) # Michael Hutchinson (mhutchinson@novell.com) -# fetch the path relative to the launch point where this shell script exists. (taken from macpack) -# $0 should contain the full path from the root i.e. /Applications/<folder>.app/Contents/MacOS/<script> -APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'` - MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current -export DYLD_FALLBACK_LIBRARY_PATH=$APP_PATH/Contents/MacOS/lib/monodevelop/bin:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib +export DYLD_FALLBACK_LIBRARY_PATH=$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib -PREFIX="$APP_PATH/Contents/MacOS" -export PREFIX +# $0 should contain the full path from the root i.e. /Applications/<folder>.app/Contents/MacOS/<script> +EXE_PATH="${0%%/mdtool}/lib/monodevelop/bin/mdrun.exe" # Work around a bug in 'exec' in older versions of macosx OSX_VERSION=$(uname -r | cut -f1 -d.) if [ $OSX_VERSION -lt 9 ]; then # If OSX version is 10.4 - MONO_EXEC="mono" + MONO_EXEC="mono" else - MONO_EXEC="exec -a mdtool mono" + MONO_EXEC="exec -a monodevelop mono" fi -## END MAC-SPECIFIC SETUP ## -### Beyond this, all is from the Linux mdtool.in, except the PREFIX and MONO_EXEC tweaks - -EXE_PATH="$PREFIX/lib/monodevelop/bin/mdrun.exe" - -MD_FORCE_DEBUG=yes +### END MAC-SPECIFIC SETUP +### Beyond this, all is from the Linux mdtool.in. Only the values of EXE_PATH and MONO_EXEC differ -for arg in "$@"; do -case x$arg in - x--profile*) - MONO_OPTIONS+=("$arg") - shift - ;; - x--debug*) - export MONODEVELOP_DISPATCH_DEBUG=yes - unset MD_FORCE_DEBUG - MONO_OPTIONS+=("$arg") - shift - ;; - x--trace*) - MONO_OPTIONS+=("$arg") - shift - ;; - x--no-debug) - unset MD_FORCE_DEBUG - shift - ;; - *) - ARGS+=("$arg") - shift - ;; -esac -done - -if [ -z MD_FORCE_DEBUG ]; then - MONO_OPTIONS+=("--debug") -fi - -if [ -n "${MONO_OPTIONS[0]}" ]; then - echo "** Running with Mono options: ${MONO_OPTIONS[@]} **" +# NOTE: remove this for stable releases +if [ -z "$MD_NO_DEBUG" ]; then + _MONO_OPTIONS=${MONO_OPTIONS:---debug} +else + _MONO_OPTIONS=$MONO_OPTIONS fi -$MONO_EXEC "${MONO_OPTIONS[@]}" "$EXE_PATH" "${ARGS[@]}" +$MONO_EXEC $_MONO_OPTIONS "$EXE_PATH" $* diff --git a/main/build/MacOSX/monodevelop b/main/build/MacOSX/monodevelop index dd98ca0e17..2a39d70e1f 100755 --- a/main/build/MacOSX/monodevelop +++ b/main/build/MacOSX/monodevelop @@ -3,74 +3,61 @@ # Author: Marc Christensen (mchristensen@novell.com) # Michael Hutchinson (mhutchinson@novell.com) -# fetch the path relative to the launch point where this shell script exists. (taken from macpack) -# $0 should contain the full path from the root i.e. /Applications/<folder>.app/Contents/MacOS/<script> -APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'` - MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current -export DYLD_FALLBACK_LIBRARY_PATH=$APP_PATH/Contents/MacOS/lib/monodevelop/bin:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib +export DYLD_FALLBACK_LIBRARY_PATH=$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib -PREFIX="$APP_PATH/Contents/MacOS" -export PREFIX +# $0 should contain the full path from the root i.e. /Applications/<folder>.app/Contents/MacOS/<script> +EXE_PATH="${0%%/monodevelop}/lib/monodevelop/bin/MonoDevelop.exe" # Work around a bug in 'exec' in older versions of macosx OSX_VERSION=$(uname -r | cut -f1 -d.) if [ $OSX_VERSION -lt 9 ]; then # If OSX version is 10.4 - MONO_EXEC="mono" + MONO_EXEC="exec mono" else - MONO_EXEC="exec -a monodevelop mono" + MONO_EXEC="exec -a monodevelop mono" fi -## END MAC-SPECIFIC SETUP ## -### Beyond this, all is from the Linux monodevelop.in, except the PREFIX and MONO_EXEC tweak - -EXE_PATH="$PREFIX/lib/monodevelop/bin/MonoDevelop.exe" - -MD_FORCE_DEBUG=yes -MD_REDIRECT_LOG="${XDG_CONFIG_HOME:-$HOME/.config}/MonoDevelop/log" +#mono version check + +REQUIRED_MAJOR=2 +REQUIRED_MINOR=4 +APPNAME="MonoDevelop" + +VERSION_TITLE="Cannot launch $APPNAME" +VERSION_MSG="$APPNAME requires the Mono Framework version $REQUIRED_MAJOR.$REQUIRED_MINOR or later." +DOWNLOAD_URL="http://www.go-mono.com/mono-downloads/download.html" + +MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )" +MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)" +MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)" +if [ -z "$MONO_VERSION" ] \ + || [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \ + || [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ] +then + osascript \ + -e "set question to display dialog \"$VERSION_MSG\" with title \"$VERSION_TITLE\" buttons {\"Cancel\", \"Download...\"} default button 2" \ + -e "if button returned of question is equal to \"Download...\" then open location \"$DOWNLOAD_URL\"" + echo "$VERSION_TITLE" + echo "$VERSION_MSG" + exit 1 +fi -for arg in "$@"; do -case "x$arg" in - x--profile*) - MONO_OPTIONS+=("$arg") - shift - ;; - x--debug*) - export MONODEVELOP_DISPATCH_DEBUG=yes - unset MD_FORCE_DEBUG - MONO_OPTIONS+=("$arg") - shift - ;; - x--trace*) - MONO_OPTIONS+=("$arg") - shift - ;; - x--no-log) - unset MD_REDIRECT_LOG - shift - ;; - x--no-debug) - unset MD_FORCE_DEBUG - shift - ;; - *) - ARGS+=("$arg") - shift - ;; -esac -done +#### END MAC-SPECIFIC SETUP +#### Beyond this, all is from the Linux monodevelop.in. Only the values of EXE_PATH and MONO_EXEC differ -if [ -z MD_FORCE_DEBUG ]; then - MONO_OPTIONS+=("--debug") -fi +_MD_REDIRECT_LOG="${MD_REDIRECT_LOG:-${XDG_CONFIG_HOME:-$HOME/.config}/MonoDevelop/log}" -if [ -n "${MONO_OPTIONS[0]}" ]; then - echo "** Running with Mono options: ${MONO_OPTIONS[@]} **" +# NOTE: remove this for stable releases +if [ -z "$MD_NO_DEBUG" ]; then + _MONO_OPTIONS=${MONO_OPTIONS:---debug} +else + _MONO_OPTIONS=$MONO_OPTIONS fi -if [ -n "$MD_REDIRECT_LOG" ]; then - mkdir -p `dirname "$MD_REDIRECT_LOG"` - $MONO_EXEC "${MONO_OPTIONS[@]}" "$EXE_PATH" "${ARGS[@]}" 2>&1 | tee "$MD_REDIRECT_LOG" +if [ -n "$_MD_REDIRECT_LOG" ]; then + mkdir -p `dirname "$_MD_REDIRECT_LOG"` + $MONO_EXEC $_MONO_OPTIONS "$EXE_PATH" $* 2>&1 | tee "$_MD_REDIRECT_LOG" else - $MONO_EXEC "${MONO_OPTIONS[@]}" "$EXE_PATH" "${ARGS[@]}" + $MONO_EXEC $_MONO_OPTIONS "$EXE_PATH" $* fi + |