X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tools%2Ftinyos%2Fmisc%2Ftos-locate-jre;h=4f93dd7945e3a886b459460fd9ab8d07f06bb694;hb=HEAD;hp=55908ed98d4b30c23f60b0d2fe33268ef17fc443;hpb=1918a9daed93b96aa539a7de52816b97e1cd415f;p=tinyos-2.x.git diff --git a/tools/tinyos/misc/tos-locate-jre b/tools/tinyos/misc/tos-locate-jre index 55908ed9..4f93dd79 100755 --- a/tools/tinyos/misc/tos-locate-jre +++ b/tools/tinyos/misc/tos-locate-jre @@ -38,17 +38,22 @@ pathlocate () { case `uname` in CYGWIN*) # Hopefully this will always work on cygwin with Sun's Java - jversion=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion'` + jversion=`regtool -q get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'` if [ $? != 0 ]; then exit 1 fi - jhome=`regtool -q get '\HKLM\SOFTWARE\JavaSoft\Java Development Kit\'$jversion'\JavaHome'` + jhome=`regtool -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'` if [ $? != 0 ]; then exit 1 fi jhome=`cygpath -u "$jhome"` ;; + Darwin) + #Just statically typed in, uses default location of installation for XTools. May need to be fixed + jhome=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK + ;; + Linux) # Check gentoo java configuration javapath=`java-config -c 2>/dev/null` @@ -108,19 +113,31 @@ if [ "$jni" = "yes" ]; then # Look for a likely JNI directory # Windows, and IBM Java: in jre/bin # Sun Java on Linux: in jre/lib/i386 - if "$jhome/bin/java" -version 2>&1 | grep -q IBM || cygpath -w / >/dev/null 2>/dev/null; then + if [ `uname` = "Darwin" ]; then + jnilocate "/Library/java/Extensions" + elif "$jhome/bin/java" -version 2>&1 | grep -q IBM || cygpath -w / >/dev/null 2>/dev/null; then jnilocate "$jhome/jre/bin" || jnilocate "$jhome/bin" else arch=`uname -m` jnilocate "$jhome/jre/lib/$arch" || \ jnilocate "$jhome/jre/lib/i386" || \ + jnilocate "$jhome/jre/lib/amd64" || \ jnilocate "$jhome/lib/$arch" || \ - jnilocate "$jhome/lib/i386" + jnilocate "$jhome/lib/i386" || \ + jnilocate "$jhome/lib/amd64" fi elif [ "$javac" = "yes" ]; then - dir="$jhome/bin" + if [ `uname` = "Darwin" ]; then + dir="$jhome/Commands" + else + dir="$jhome/bin" + fi elif [ "$java" = "yes" ]; then - dir="$jhome/bin" + if [ `uname` = "Darwin" ]; then + dir="$jhome/Commands" + else + dir="$jhome/bin" + fi fi # Check that what we found actually exists