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

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