source: trunk/openjdk/langtools/src/share/bin/launcher.sh-template

Last change on this file was 278, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b22 from branches/vendor/oracle.

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