aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorNic Ferrier <nferrier@gcc.gnu.org>2002-02-20 23:12:25 +0000
committerNic Ferrier <nferrier@gcc.gnu.org>2002-02-20 23:12:25 +0000
commitdb444fbe8e0c175e38c49560c852181678c8ef1d (patch)
tree8669888d476de6362ca887ed220ce715d09dd392 /gcc/java
parent3704ef744f0b39b4c28d84bef7702644b62ccefb (diff)
downloadgcc-db444fbe8e0c175e38c49560c852181678c8ef1d.zip
gcc-db444fbe8e0c175e38c49560c852181678c8ef1d.tar.gz
gcc-db444fbe8e0c175e38c49560c852181678c8ef1d.tar.bz2
gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option `--CLASSPATH' becomes...
* gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option `--CLASSPATH' becomes `--classpath.' * gjavah.c: Likewise. * jcf-dump.c: Likewise. * lang-options.h: Likewise. * lang.c: Likewise. * jcf-path.c: Updated comment. (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.' (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.' * jcf.h (jcf_path_CLASSPATH_arg): Ditto. (jcf_path_CLASSPATH_arg): Ditto. (classpath_u): Updated leading comment. From-SVN: r49918
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/gcj.texi18
-rw-r--r--gcc/java/gjavah.c67
-rw-r--r--gcc/java/jcf-dump.c29
-rw-r--r--gcc/java/jcf-path.c21
-rw-r--r--gcc/java/jcf.h2
-rw-r--r--gcc/java/lang-options.h4
-rw-r--r--gcc/java/lang.c8
7 files changed, 79 insertions, 70 deletions
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 1bdd746..e7b97d2 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -141,7 +141,7 @@ files and object files, and it can read both Java source code and
@ignore
@c man begin SYNOPSIS gcj
gcj [@option{-I}@var{dir}@dots{}] [@option{-d} @var{dir}@dots{}]
- [@option{--classpath}=@var{path}] [@option{--CLASSPATH}=@var{path}]
+ [@option{--CLASSPATH}=@var{path}] [@option{--classpath}=@var{path}]
[@option{-f}@var{option}@dots{}] [@option{--encoding}=@var{name}]
[@option{--main}=@var{classname}] [@option{-D}@var{name}[=@var{value}]@dots{}]
[@option{-C}] [@option{-R} @var{resource-name}] [@option{-d} @var{directory}]
@@ -240,11 +240,12 @@ compatibility with tools like @code{javac} is imported, we recommend
always using @code{-I} instead of the other options for manipulating the
class path.
-@item --classpath=@var{path}
+@item --CLASSPATH=@var{path}
This sets the class path to @var{path}, a colon-separated list of paths
-(on Windows-based systems, a semicolon-separate list of paths).
+(on Windows-based systems, a semicolon-separate list of paths). Using
+this option causes the built in path to be suppressed.
-@item --CLASSPATH=@var{path}
+@item --classpath=@var{path}
This sets the class path to @var{path}, a colon-separated list of paths
(on Windows-based systems, a semicolon-separate list of paths). This
differs from the @code{--classpath} option in that it does not suppress
@@ -261,17 +262,18 @@ The final class path is constructed like so:
First come all directories specified via @code{-I}.
@item
-If @code{--classpath} is specified, its value is appended and processing
-stops. That is, @code{--classpath} suppresses all the options mentioned
+If @option{--CLASSPATH} is specified, its value is appended and processing
+stops. That is, @option{--CLASSPATH} suppresses all the options mentioned
later in this list.
@item
-If @code{--CLASSPATH} is specified, its value is appended and the
+If @option{--classpath} is specified, its value is appended and the
@code{CLASSPATH} environment variable is suppressed.
@item
If the @code{CLASSPATH} environment variable is specified (and was not
-suppressed by @code{--CLASSPATH}), then its value is appended.
+suppressed by @option{--classpath} or @option{--CLASSPATH}), then its
+value is appended.
@item
Finally, the built-in system directory, @file{libgcj.jar}, is appended.
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 9b205f4..7034e58 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -2101,41 +2101,41 @@ DEFUN(process_file, (jcf, out),
/* This is used to mark options with no short value. */
#define LONG_OPT(Num) ((Num) + 128)
-#define OPT_classpath LONG_OPT (0)
-#define OPT_CLASSPATH LONG_OPT (1)
-#define OPT_HELP LONG_OPT (2)
-#define OPT_TEMP LONG_OPT (3)
-#define OPT_VERSION LONG_OPT (4)
-#define OPT_PREPEND LONG_OPT (5)
-#define OPT_FRIEND LONG_OPT (6)
-#define OPT_ADD LONG_OPT (7)
-#define OPT_APPEND LONG_OPT (8)
-#define OPT_M LONG_OPT (9)
-#define OPT_MM LONG_OPT (10)
-#define OPT_MG LONG_OPT (11)
-#define OPT_MD LONG_OPT (12)
-#define OPT_MMD LONG_OPT (13)
+#define OPT_classpath LONG_OPT (0)
+#define OPT_CLASSPATH LONG_OPT (1)
+#define OPT_HELP LONG_OPT (2)
+#define OPT_TEMP LONG_OPT (3)
+#define OPT_VERSION LONG_OPT (4)
+#define OPT_PREPEND LONG_OPT (5)
+#define OPT_FRIEND LONG_OPT (6)
+#define OPT_ADD LONG_OPT (7)
+#define OPT_APPEND LONG_OPT (8)
+#define OPT_M LONG_OPT (9)
+#define OPT_MM LONG_OPT (10)
+#define OPT_MG LONG_OPT (11)
+#define OPT_MD LONG_OPT (12)
+#define OPT_MMD LONG_OPT (13)
static const struct option options[] =
{
- { "classpath", required_argument, NULL, OPT_classpath },
- { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH },
- { "help", no_argument, NULL, OPT_HELP },
- { "stubs", no_argument, &stubs, 1 },
- { "td", required_argument, NULL, OPT_TEMP },
- { "verbose", no_argument, NULL, 'v' },
- { "version", no_argument, NULL, OPT_VERSION },
- { "prepend", required_argument, NULL, OPT_PREPEND },
- { "friend", required_argument, NULL, OPT_FRIEND },
- { "add", required_argument, NULL, OPT_ADD },
- { "append", required_argument, NULL, OPT_APPEND },
- { "M", no_argument, NULL, OPT_M },
- { "MM", no_argument, NULL, OPT_MM },
- { "MG", no_argument, NULL, OPT_MG },
- { "MD", no_argument, NULL, OPT_MD },
- { "MMD", no_argument, NULL, OPT_MMD },
- { "jni", no_argument, &flag_jni, 1 },
- { NULL, no_argument, NULL, 0 }
+ { "classpath", required_argument, NULL, OPT_classpath },
+ { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH },
+ { "help", no_argument, NULL, OPT_HELP },
+ { "stubs", no_argument, &stubs, 1 },
+ { "td", required_argument, NULL, OPT_TEMP },
+ { "verbose", no_argument, NULL, 'v' },
+ { "version", no_argument, NULL, OPT_VERSION },
+ { "prepend", required_argument, NULL, OPT_PREPEND },
+ { "friend", required_argument, NULL, OPT_FRIEND },
+ { "add", required_argument, NULL, OPT_ADD },
+ { "append", required_argument, NULL, OPT_APPEND },
+ { "M", no_argument, NULL, OPT_M },
+ { "MM", no_argument, NULL, OPT_MM },
+ { "MG", no_argument, NULL, OPT_MG },
+ { "MD", no_argument, NULL, OPT_MD },
+ { "MMD", no_argument, NULL, OPT_MMD },
+ { "jni", no_argument, &flag_jni, 1 },
+ { NULL, no_argument, NULL, 0 }
};
static void
@@ -2158,8 +2158,9 @@ help ()
printf (" -friend TEXT Insert TEXT as `friend' declaration\n");
printf (" -prepend TEXT Insert TEXT before start of class\n");
printf ("\n");
+ printf (" --CLASSPATH PATH Set path to find .class files, overriding\n\
+ built-in class path\n");
printf (" --classpath PATH Set path to find .class files\n");
- printf (" --CLASSPATH PATH Set path to find .class files\n");
printf (" -IDIR Append directory to class path\n");
printf (" -d DIRECTORY Set output directory name\n");
printf (" -o FILE Set output file name\n");
diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c
index 756e43d..c845067 100644
--- a/gcc/java/jcf-dump.c
+++ b/gcc/java/jcf-dump.c
@@ -773,22 +773,22 @@ DEFUN(process_class, (jcf),
/* This is used to mark options with no short value. */
#define LONG_OPT(Num) ((Num) + 128)
-#define OPT_classpath LONG_OPT (0)
-#define OPT_CLASSPATH LONG_OPT (1)
-#define OPT_HELP LONG_OPT (2)
-#define OPT_VERSION LONG_OPT (3)
-#define OPT_JAVAP LONG_OPT (4)
+#define OPT_classpath LONG_OPT (0)
+#define OPT_CLASSPATH LONG_OPT (1)
+#define OPT_HELP LONG_OPT (2)
+#define OPT_VERSION LONG_OPT (3)
+#define OPT_JAVAP LONG_OPT (4)
static const struct option options[] =
{
- { "classpath", required_argument, NULL, OPT_classpath },
- { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH },
- { "help", no_argument, NULL, OPT_HELP },
- { "verbose", no_argument, NULL, 'v' },
- { "version", no_argument, NULL, OPT_VERSION },
- { "javap", no_argument, NULL, OPT_JAVAP },
- { "print-main", no_argument, &flag_print_main, 1 },
- { NULL, no_argument, NULL, 0 }
+ { "classpath", required_argument, NULL, OPT_classpath },
+ { "CLASSPATH", required_argument, NULL, OPT_CLASSPATH },
+ { "help", no_argument, NULL, OPT_HELP },
+ { "verbose", no_argument, NULL, 'v' },
+ { "version", no_argument, NULL, OPT_VERSION },
+ { "javap", no_argument, NULL, OPT_JAVAP },
+ { "print-main", no_argument, &flag_print_main, 1 },
+ { NULL, no_argument, NULL, 0 }
};
static void
@@ -806,8 +806,9 @@ help ()
printf (" -c Disassemble method bodies\n");
printf (" --javap Generate output in `javap' format\n");
printf ("\n");
+ printf (" --CLASSPATH PATH Set path to find .class files, overriding\n\
+ built-in class path\n");
printf (" --classpath PATH Set path to find .class files\n");
- printf (" --CLASSPATH PATH Set path to find .class files\n");
printf (" -IDIR Append directory to class path\n");
printf (" -o FILE Set output file name\n");
printf ("\n");
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index 079cb36..efdd843 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -71,8 +71,8 @@ static void add_path PARAMS ((struct entry **, const char *, int));
built-in system directory (only libgcj.jar)
CLASSPATH environment variable
- -CLASSPATH overrides CLASSPATH
- -classpath option - overrides CLASSPATH, -CLASSPATH, and built-in
+ -classpath option overrides $CLASSPATH
+ -CLASSPATH option overrides $CLASSPATH, -classpath, and built-in
-I prepends path to list
We implement this by keeping several path lists, and then simply
@@ -84,10 +84,10 @@ static struct entry *include_dirs;
/* This holds the CLASSPATH environment variable. */
static struct entry *classpath_env;
-/* This holds the -CLASSPATH command-line option. */
+/* This holds the -classpath command-line option. */
static struct entry *classpath_u;
-/* This holds the -classpath command-line option. */
+/* This holds the -CLASSPATH command-line option. */
static struct entry *classpath_l;
/* This holds the default directories. Some of these will have the
@@ -284,18 +284,23 @@ jcf_path_init ()
add_path (&classpath_env, cp, 0);
}
-/* Call this when -classpath is seen on the command line. */
+/* Call this when -CLASSPATH is seen on the command line.
+ This is the override-all switch, even the built in classes
+ are overridden.
+ */
void
-jcf_path_classpath_arg (path)
+jcf_path_CLASSPATH_arg (path)
const char *path;
{
free_entry (&classpath_l);
add_path (&classpath_l, path, 0);
}
-/* Call this when -CLASSPATH is seen on the command line. */
+/* Call this when -classpath is seen on the command line.
+ This overrides only the $CLASSPATH environment variable.
+ */
void
-jcf_path_CLASSPATH_arg (path)
+jcf_path_classpath_arg (path)
const char *path;
{
free_entry (&classpath_u);
diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h
index ef7669e..86a0c55 100644
--- a/gcc/java/jcf.h
+++ b/gcc/java/jcf.h
@@ -271,8 +271,8 @@ extern void jcf_dependency_print_dummies PARAMS ((void));
/* Declarations for path handling code. */
extern void jcf_path_init PARAMS ((void));
-extern void jcf_path_classpath_arg PARAMS ((const char *));
extern void jcf_path_CLASSPATH_arg PARAMS ((const char *));
+extern void jcf_path_classpath_arg PARAMS ((const char *));
extern void jcf_path_include_arg PARAMS ((const char *));
extern void jcf_path_seal PARAMS ((int));
extern void *jcf_path_start PARAMS ((void));
diff --git a/gcc/java/lang-options.h b/gcc/java/lang-options.h
index 06a4c4d..130060c 100644
--- a/gcc/java/lang-options.h
+++ b/gcc/java/lang-options.h
@@ -32,9 +32,9 @@ DEFINE_LANG_NAME ("Java")
N_("Disable automatic array bounds checking") },
{ "-fjni",
N_("Assume native functions are implemented using JNI") },
- { "--classpath",
- N_("Set class path and suppress system path") },
{ "--CLASSPATH",
+ N_("Set class path and suppress system path") },
+ { "--classpath",
N_("Set class path") },
{ "--main",
N_("Choose class whose main method should be used") },
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 0f62594..1520390 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -299,17 +299,17 @@ java_decode_option (argc, argv)
return 1;
}
#undef CLARG
-#define CLARG "-fclasspath="
+#define CLARG "-fCLASSPATH="
if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
{
- jcf_path_classpath_arg (p + sizeof (CLARG) - 1);
+ jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1);
return 1;
}
#undef CLARG
-#define CLARG "-fCLASSPATH="
+#define CLARG "-fclasspath="
if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
{
- jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1);
+ jcf_path_classpath_arg (p + sizeof (CLARG) - 1);
return 1;
}
#undef CLARG