annotate build-aux/javacomp.sh.in @ 7376:5b76a3b030e7

.
author Karl Berry <karl@freefriends.org>
date Wed, 27 Sep 2006 07:37:50 +0000
parents 987fd3cc122a
children bbbbbf4cd1c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 # Compile a Java program.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
4 # Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 # Written by Bruno Haible <haible@clisp.cons.org>, 2001.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 #
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # This program is free software; you can redistribute it and/or modify
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 # the Free Software Foundation; either version 2, or (at your option)
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 # any later version.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 #
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 # GNU General Public License for more details.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 #
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 # along with this program; if not, write to the Free Software Foundation,
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
19 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 # This uses the same choices as javacomp.c, but instead of relying on the
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 # environment settings at run time, it uses the environment variables
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 # present at configuration time.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 # This is a separate shell script, because it must be able to unset JAVA_HOME
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 # in some cases, which a simple shell command cannot do.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 # The extra CLASSPATH must have been set prior to calling this script.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # Options that can be passed are -O, -g and "-d DIRECTORY".
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
31 CONF_JAVAC='@CONF_JAVAC@'
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 CONF_CLASSPATH='@CLASSPATH@'
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
33 if test -n "@HAVE_JAVAC_ENVVAR@"; then
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 # Combine given CLASSPATH and configured CLASSPATH.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 if test -n "$CLASSPATH"; then
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 CLASSPATH="$CONF_CLASSPATH"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 fi
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 export CLASSPATH
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 exec $CONF_JAVAC "$@"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 unset JAVA_HOME
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 if test -n "@HAVE_GCJ_C@"; then
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
46 # In this case, $CONF_JAVAC starts with "gcj -C".
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 CLASSPATH="$CLASSPATH"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 export CLASSPATH
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
49 test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
50 exec $CONF_JAVAC "$@"
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 if test -n "@HAVE_JAVAC@"; then
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
53 # In this case, $CONF_JAVAC starts with "javac".
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 CLASSPATH="$CLASSPATH"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 export CLASSPATH
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
56 test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
57 exec $CONF_JAVAC "$@"
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 if test -n "@HAVE_JIKES@"; then
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
60 # In this case, $CONF_JAVAC starts with "jikes".
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 # Combine given CLASSPATH and configured CLASSPATH.
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 if test -n "$CLASSPATH"; then
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 CLASSPATH="$CONF_CLASSPATH"
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 fi
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 export CLASSPATH
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
68 test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 6518
diff changeset
69 exec $CONF_JAVAC "$@"
6518
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 else
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 echo 'Java compiler not found, try installing gcj or set $JAVAC, then reconfigure' 1>&2
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 exit 1
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 fi
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 fi
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 fi
59d011e023ff Moved here from lib/javacomp.sh.in.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 fi