src/share/bin/launcher.sh-template

Tue, 21 Dec 2010 16:29:10 -0800

author
jjh
date
Tue, 21 Dec 2010 16:29:10 -0800
changeset 805
7c33098600b2
parent 656
6ef801fa38b7
child 871
bfa59f3e84bd
permissions
-rw-r--r--

7008378: javac bootstrap launcher fails on cygwin when called via an absolute path
Summary: Use cygpath if it is cygwin
Reviewed-by: ksrini

duke@1 1 #!/bin/sh
duke@1 2
duke@1 3 #
ohair@554 4 # Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
duke@1 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 6 #
duke@1 7 # This code is free software; you can redistribute it and/or modify it
duke@1 8 # under the terms of the GNU General Public License version 2 only, as
ohair@554 9 # published by the Free Software Foundation. Oracle designates this
duke@1 10 # particular file as subject to the "Classpath" exception as provided
ohair@554 11 # by Oracle in the LICENSE file that accompanied this code.
duke@1 12 #
duke@1 13 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 16 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 17 # accompanied this code).
duke@1 18 #
duke@1 19 # You should have received a copy of the GNU General Public License version
duke@1 20 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 22 #
ohair@554 23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 24 # or visit www.oracle.com if you need additional information or have any
ohair@554 25 # questions.
duke@1 26 #
duke@1 27
duke@1 28 mydir="`dirname $0`"
jjh@805 29 case `uname -s` in
jjh@805 30 CYGWIN*)
jjh@805 31 mydir=`cygpath -m $mydir`
jjh@805 32 ;;
jjh@805 33 esac
jjh@805 34
duke@1 35 mylib="`dirname $mydir`"/lib
duke@1 36
duke@1 37 # By default, put the jar file and its dependencies on the bootclasspath.
duke@1 38 # This is always required on a Mac, because the system langtools classes
duke@1 39 # are always on the main class path; in addition, it may be required on
duke@1 40 # standard versions of JDK (i.e. using rt.jar and tools.jar) because some
duke@1 41 # langtools interfaces are in rt.jar.
duke@1 42 # Assume that the jar file being invoked lists all the necessary langtools
duke@1 43 # jar files in its Class-Path manifest entry, so there is no need to search
duke@1 44 # dependent jar files for additional dependencies.
duke@1 45
duke@1 46 if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then
jjg@471 47 cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF |
duke@1 48 grep "Class-Path:" |
jjg@656 49 sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1#PS#|g'`
jjg@656 50 bcp="$mylib/#PROGRAM#.jar#PS#$cp"
duke@1 51 fi
duke@1 52
jjg@308 53 # tools currently assumes that assertions are enabled in the launcher
jjg@370 54 ea=-ea:com.sun.tools...
duke@1 55
jjg@308 56 # Any parameters starting with -J are passed to the JVM.
jjg@308 57 # All other parameters become parameters of #PROGRAM#.
jjg@308 58
jjg@308 59 # Separate out -J* options for the JVM
jjg@308 60 # Unset IFS and use newline as arg separator to preserve spaces in args
jjg@308 61 DUALCASE=1 # for MKS: make case statement case-sensitive (6709498)
jjg@308 62 saveIFS="$IFS"
jjg@308 63 nl='
jjg@308 64 '
jjg@308 65 for i in "$@" ; do
jjg@308 66 IFS=
jjg@308 67 case $i in
jjg@308 68 -J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
jjg@308 69 * ) toolOpts=$toolOpts$nl$i ;;
jjg@308 70 esac
jjg@308 71 IFS="$saveIFS"
jjg@308 72 done
jjg@308 73 unset DUALCASE
jjg@308 74
jjg@548 75 IFS=$nl
jjg@548 76 "#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/#PROGRAM#.jar ${toolOpts}

mercurial