aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2012-08-10 22:58:20 +0800
committerTat-Chee Wan (USM)2012-08-10 22:58:20 +0800
commitb04bb1bd7f227b9eaf320609e92cc95ed69aa448 (patch)
treed59e0d09d8848a8bf482ff0478d245364597ea9c
parent5053ae8cd3eab5f0c1a929c1836078f0aadeb6f1 (diff)
automated python version invocation for cross-platform support
-rwxr-xr-xHost/pyenv-nxt-gdb-server27
1 files changed, 26 insertions, 1 deletions
diff --git a/Host/pyenv-nxt-gdb-server b/Host/pyenv-nxt-gdb-server
index 875e92e..45797c6 100755
--- a/Host/pyenv-nxt-gdb-server
+++ b/Host/pyenv-nxt-gdb-server
@@ -1,3 +1,28 @@
#!/bin/sh
+# If using Apple's python, use the following to enable 32-bit python
+# arch -i386 does not work reliably except with specific python versions
+# python2.6 and python2.7 is known to work with 'arch -i386'
+#
+# Apple recommends the use of the following Environment Variable to control
+# 32-bit vs. 64-bit python selection
+# export VERSIONER_PYTHON_PREFER_32_BIT="yes"
+
+DARWIN=`uname`
+PYTHON=python
+PYTHONVER=`$PYTHON --version`
+
+if [ $DARWIN == "Darwin" ]; then
+ echo "$PYTHONVER Running on Mac OSX Platform!"
+ EXP="export VERSIONER_PYTHON_PREFER_32_BIT=yes"
+ ARCH="arch -i386"
+else
+ echo "$PYTHONVER Running on Default Platform!"
+ EXP=
+ ARCH=
+fi
+# Debugging Info
+# echo "dirname:" `dirname $0`
+# echo "basename:" `basename $0`
export PYTHONPATH=~/svnrepo/nxt-python:~/gitrepo/pyfantom
-arch -i386 /usr/bin/python2.6 ~/gitrepo/armdebug/Host/nxt-gdb-server.py $*
+#echo $EXP; $ARCH $PYTHON ~/gitrepo/armdebug/Host/nxt-gdb-server.py $*
+$EXP; $ARCH $PYTHON ~/gitrepo/armdebug/Host/nxt-gdb-server.py $*