From owner-freebsd-java Fri Mar 14 7:31: 5 2003 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3ADDC37B401 for ; Fri, 14 Mar 2003 07:31:01 -0800 (PST) Received: from hfep01.dion.ne.jp (hfep01.dion.ne.jp [203.181.105.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AD5743FAF for ; Fri, 14 Mar 2003 07:30:59 -0800 (PST) (envelope-from haro@h4.dion.ne.jp) Received: from localhost ([211.5.14.72]) by hfep01.dion.ne.jp with ESMTP id <20030314153057299.WWTS@hfep01.dion.ne.jp>; Sat, 15 Mar 2003 00:30:57 +0900 Date: Sat, 15 Mar 2003 00:30:54 +0900 (JST) Message-Id: <20030315.003054.74755042.haro@h4.dion.ne.jp> To: Greg Lewis Cc: freebsd-java@FreeBSD.ORG Subject: [CFR] jdk1.3.1 java_wrapper script update patch From: Munehiro Matsuda X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sat_Mar_15_00:30:54_2003_586)--" Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ----Next_Part(Sat_Mar_15_00:30:54_2003_586)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello Greg and all, I've created a patch which updates java_wrapper shell-script for jdk-1.3.1, that addresses the issues with classic/hotspot VM mixed environment. Main changes are: 1. Properly handle -client/-server options. 2. Recognise -classic/-green/-native/-client/-server/-hotspot arguments, and pass appropriate argument to the executing command. 3. Honer THREADS_FLAG environment variable more. With these changes, following suceeds, even with hotspot installed: java -version java -classic -version java -green -version java -native -version java -client -version java -server -version java -hotspot -version I'd appriciate any feed back with it. Thank you, Haro =------------------------------------------------------------------------------ _ _ Munehiro (haro) Matsuda -|- /_\ |_|_| Business Incubation Dept., Kubota Corp. /|\ |_| |_|_| 1-3 Nihonbashi-Muromachi 3-Chome Chuo-ku Tokyo 103-8310, Japan Tel: +81-3-3245-3318 Fax: +81-3-3245-3315 Email: haro@kgt.co.jp ----Next_Part(Sat_Mar_15_00:30:54_2003_586)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-java_wrapper_bsd.sh" --- ../src/solaris/bin/java_wrapper_bsd.sh.org Fri Mar 14 18:42:05 2003 +++ ../src/solaris/bin/java_wrapper_bsd.sh Fri Mar 14 19:03:36 2003 @@ -71,37 +71,60 @@ # Select vm type (if classic vm, also select thread type). unset vmtype unset ttype +unset vmopt DEFAULT_THREADS_FLAG=green -if [ "x$1" = "x-hotspot" ]; then - vmtype=hotspot +if [ "x$1" = "x-client" ]; then + vmtype=client ttype=native_threads + vmopt=-$vmtype shift 1 else if [ "x$1" = "x-classic" ]; then vmtype=classic - ttype=${DEFAULT_THREADS_FLAG}_threads + if [ ${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}} = native ]; then + ttype=native_threads + else + ttype=green_threads + fi + vmopt=-$vmtype shift 1 else if [ "x$1" = "x-green" ]; then vmtype=classic ttype=green_threads + vmopt=-$vmtype shift 1 else if [ "x$1" = "x-native" ]; then vmtype=classic ttype=native_threads + vmopt=-$vmtype shift 1 else - if [ -d ${jre}/lib/${proc}/hotspot ]; then - vmtype=hotspot + if [ "x$1" = "x-server" ]; then + vmtype=server ttype=native_threads - else - vmtype=classic - if [ ${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}} = native ] - then + vmopt=-$vmtype + shift 1 + else + if [ "x$1" = "x-hotspot" ]; then + vmtype=client ttype=native_threads - else - ttype=green_threads + vmopt=-$vmtype + shift 1 + else + if [ -d ${jre}/lib/${proc}/client ]; then + vmtype=client + ttype=native_threads + else + vmtype=classic + if [ ${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}} = native ] + then + ttype=native_threads + else + ttype=green_threads + fi + fi fi fi fi @@ -141,7 +164,11 @@ # Run. if [ -x "$prog" ] then - exec $DEBUG_PROG "$prog" "$@" + if [ "x$DEBUG_PROG" = "x" ]; then + exec "$prog" $vmopt "$@" + else + exec $DEBUG_PROG "$prog" "$@" + fi else echo >&2 "$progname was not found in ${prog}" exit 1 ----Next_Part(Sat_Mar_15_00:30:54_2003_586)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message