2 # Compile a Java program.
4 # Copyright (C) 2001-2002 Free Software Foundation, Inc.
5 # Written by Bruno Haible <haible@clisp.cons.org>, 2001.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software Foundation,
19 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 # This uses the same choices as javacomp.c, but instead of relying on the
22 # environment settings at run time, it uses the environment variables
23 # present at configuration time.
25 # This is a separate shell script, because it must be able to unset JAVA_HOME
26 # in some cases, which a simple shell command cannot do.
28 # The extra CLASSPATH must have been set prior to calling this script.
29 # Options that can be passed are -O, -g and "-d DIRECTORY".
32 CONF_CLASSPATH
='@CLASSPATH@'
33 if test -n "$CONF_JAVAC"; then
34 # Combine given CLASSPATH and configured CLASSPATH.
35 if test -n "$CLASSPATH"; then
36 CLASSPATH
="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
38 CLASSPATH
="$CONF_CLASSPATH"
41 test -z "$JAVA_VERBOSE" ||
echo "$CONF_JAVAC $@"
45 if test -n "@HAVE_GCJ_C@"; then
46 CLASSPATH
="$CLASSPATH"
48 test -z "$JAVA_VERBOSE" ||
echo gcj
-C "$@"
51 if test -n "@HAVE_JAVAC@"; then
52 CLASSPATH
="$CLASSPATH"
54 test -z "$JAVA_VERBOSE" ||
echo javac
"$@"
57 if test -n "@HAVE_JIKES@"; then
58 # Combine given CLASSPATH and configured CLASSPATH.
59 if test -n "$CLASSPATH"; then
60 CLASSPATH
="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
62 CLASSPATH
="$CONF_CLASSPATH"
65 test -z "$JAVA_VERBOSE" ||
echo jikes
"$@"
68 echo 'Java compiler not found, try installing gcj or set $JAVAC, then reconfigure' 1>&2