[GRASS-SVN] r34960 - grass/branches/develbranch_6/macosx/app

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 20 16:06:35 EST 2008


Author: kyngchaos
Date: 2008-12-20 16:06:35 -0500 (Sat, 20 Dec 2008)
New Revision: 34960

Modified:
   grass/branches/develbranch_6/macosx/app/grass.sh.in
Log:
look for user tcltk (aqua 8.5 or x11 8.4) to avoid accidental use of system tcltk

Modified: grass/branches/develbranch_6/macosx/app/grass.sh.in
===================================================================
--- grass/branches/develbranch_6/macosx/app/grass.sh.in	2008-12-20 17:29:03 UTC (rev 34959)
+++ grass/branches/develbranch_6/macosx/app/grass.sh.in	2008-12-20 21:06:35 UTC (rev 34960)
@@ -87,6 +87,54 @@
 	USERTERM="Terminal"
 fi
 
+# Some reasonable Wish defaults, to avoid accidental use of the
+# system TclTk.  Avoid non-working combination Aqua 8.4.
+# System tcltk has "wish" & "tclsh" symlinks, Aqua and user builds do not.
+# assume user TclTk progs in default build location /usr/local/bin.
+# check even if /usr/local/bin not in PATH, this is where Aqua will be
+# also assume matching tclsh alongside wish
+if [ ! "$GRASS_WISH" ] ; then
+	gwish=""
+	gtclsh=""
+	if [ -e "/usr/local/bin/wish8.5" ] ; then
+		gwish="/usr/local/bin/wish8.5"
+		gtclsh="/usr/local/bin/tclsh8.5"
+	else
+		# check for any other wish8.5
+		wish85=`type -p wish8.5`
+		tclsh85=`type -p tclsh8.5`
+		if [ "$wish85" ] ; then
+			gwish="$wish85"
+			gtclsh="$tclsh85"
+		else
+			# check for any wish8.4
+			wish84=`type -p wish8.4`
+			tclsh84=`type -p tclsh8.4`
+			if [ ! "$wish84" ] ; then
+				# or maybe /usr/local/bin not in PATH
+				wish84="/usr/local/bin/wish8.4"
+				tclsh84="/usr/local/bin/tclsh8.4"
+			fi
+			if [ -e "$wish84" ] ; then
+				# make sure it's not aqua
+				# aqua wish is a shell script that starts framework wish
+				if [ "`file $wish84 | grep 'shell script'`" ] ; then
+					echo "Warning: TclTk Aqua 8.4 unsupported"
+				else
+					gwish="$wish84"
+					gtclsh="$tclsh84"
+				fi
+			fi
+		fi
+	fi
+	if [ "$gwish" ] ; then
+		GRASS_WISH="$gwish"
+		export GRASS_WISH
+		GRASS_TCLSH="$gtclsh"
+		export GRASS_TCLSH
+	fi
+fi
+
 ### X11 stuff
 
 if [ "@X11@" ] ; then



More information about the grass-commit mailing list